diff --git a/articles/quickstart/webapp/nextjs/01-login.md b/articles/quickstart/webapp/nextjs/01-login.md index 74d19680bc..699d3c2f05 100644 --- a/articles/quickstart/webapp/nextjs/01-login.md +++ b/articles/quickstart/webapp/nextjs/01-login.md @@ -212,13 +212,23 @@ The `user` property contains sensitive information and artifacts related to the The profile information is available through the `user` property exposed by the `getSession` function. Take this Server Component as an example of how to use it: ```jsx +// Implementation for App Router import { auth0 } from "@/lib/auth0"; export default async function ProfileServer() { const { user } = await auth0.getSession(); return ( user && (
{user.name}/

{user.name}

{user.email}

) ); } +``` + +```jsx +// Implementation for Pages Router +import { auth0 } from "@/lib/auth0"; +export default async function ProfileServer(req) { + const { user } = await auth0.getSession(req); // As you can see here, `getSession` required to receive the `req` object as parameter, only in Pages Router + return ( user && (
{user.name}/

{user.name}

{user.email}

) ); +} ``` :::panel Checkpoint