Next.js Discord

Discord Forum

how to get revalidated from the server side page as i ma using here next auth session to render the

Unanswered
Eyebrowed Thrush posted this in #help-forum
Open in Discord
Eyebrowed ThrushOP
how to get revalidated from the server side page as i ma using here next auth session to render the diff page depending up user login status
import Navbar from "@/components/Navbar"; import { getServerSession } from "next-auth"; import React from "react"; import { authOptions } from "./api/auth/[...nextauth]/route"; export default async function page() { const session = await getServerSession(authOptions); return ( <div> <Navbar /> <div className="container mx-auto px-4 mt-6"> {session ? ( <h1>Protected Content</h1> ) : ( <p>Login karle mere bhai</p> )} </div> </div> ); }

but when i make login a redirect to the home page the state of the user doesn't get changed

0 Replies