Next.js Discord

Discord Forum

confused about fetch calls when getting session value from cookie

Unanswered
Kurilian Bobtail posted this in #help-forum
Open in Discord
Kurilian BobtailOP
i'm relatively new to next js, i am super confused as to why it has this localhost:3000/ fetch call whenever i try to use this getsession function somewhere
const session = await getSession();

auth.ts
export async function getSession() {
  const session = cookies().get("session")?.value;
  if (!session) return null;
  return await decrypt(session);
}


i just followed this guide and update
https://github.com/balazsorban44/auth-poc-next/blob/main/app/layout.tsx

0 Replies