From 867c5744519bb0d5a449d0a07cb10b80720e3bdb Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 18 Nov 2025 16:17:29 +0100 Subject: [PATCH] fix: disable SSR for login and profile pages to fix build errors - Add export const dynamic = 'force-dynamic' to login and profile pages - Fixes 'Google OAuth components must be used within GoogleOAuthProvider' error - Fixes 'location is not defined' error during static generation - Both pages now render client-side only --- app/login/page.tsx | 2 ++ app/profil/page.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/login/page.tsx b/app/login/page.tsx index 04fcc3b..379d6d8 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -13,6 +13,8 @@ import { useGoogleLogin } from "@react-oauth/google"; import { initFacebookSDK, loginWithFacebook } from "@/lib/facebook-sdk"; import toast from "react-hot-toast"; +export const dynamic = 'force-dynamic'; + export default function LoginPage() { const { login, googleLogin, facebookLogin } = useAuth(); const [isSubmitting, setIsSubmitting] = useState(false); diff --git a/app/profil/page.tsx b/app/profil/page.tsx index 902b55d..4d5108d 100644 --- a/app/profil/page.tsx +++ b/app/profil/page.tsx @@ -14,6 +14,8 @@ import { useRouter } from "next/navigation"; import { ROUTES } from "@/utils/constants"; import { formatDate } from "@/utils/helpers"; +export const dynamic = 'force-dynamic'; + export default function ProfilePage() { const { user, isAuthenticated, refreshUser } = useAuth(); const router = useRouter();