diff --git a/src/components/auth-provider.tsx b/src/components/auth-provider.tsx index e051f0e..7d7c3ff 100644 --- a/src/components/auth-provider.tsx +++ b/src/components/auth-provider.tsx @@ -30,6 +30,13 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { const pathname = usePathname(); const fetchUser = async () => { + // Skip the backend call if the user doesn't even have the auth cookie + if (typeof document !== 'undefined' && !document.cookie.includes(AUTH_COOKIE_NAME)) { + setUser(null); + setLoading(false); + return; + } + try { const res = await fetch('/api/auth/me'); if (res.ok) {