From 634d95a8fb3261fd8b0beba460ec5ee07af104f6 Mon Sep 17 00:00:00 2001
From: Adam Mcgrath Note: You can't write to the cookie in a React Server Component, so updates
to the session like setting the expiry of the rolling session won't be persisted.
-For this, we recommend touching the session in the middleware using Type declaration
getSession
or
-withMiddlewareAuthRequired
.
You can also get the session in a page or route in the Edge Runtime:
// app/my-api/route.js
import { getSession } from '@auth0/nextjs-auth0/edge'; // Note the /edge import
export default async function MyPage({ params, searchParams }) {
const { user } = await getSession();
return <h1>My Page</h1>;
}
export const runtime = 'edge';
@@ -59,7 +58,7 @@ Rest
Returns Promise<default | null | undefined>
+