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
This commit is contained in:
parent
41ab64640f
commit
867c574451
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user