Skip to content

Commit

Permalink
fix: typo in custom-session-token docs (#1787)
Browse files Browse the repository at this point in the history
  • Loading branch information
zchsh authored Dec 10, 2024
1 parent f3b88b2 commit ff3c224
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/backend-requests/making/custom-session-token.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ This guide will show you how to customize a session token to include additional
export default async function Page() {
const { sessionClaims } = await auth()

const firstName = sessionClaims?.fullName
const fullName = sessionClaims?.fullName

const primaryEmail = sessionClaims?.primaryEmail

return NextResponse.json({ firstName, primaryEmail })
return NextResponse.json({ fullName, primaryEmail })
}
```

Expand All @@ -55,11 +55,11 @@ This guide will show you how to customize a session token to include additional
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const { sessionClaims } = getAuth(req)

const firstName = sessionClaims.fullName
const fullName = sessionClaims.fullName

const primaryEmail = sessionClaims.primaryEmail

return res.status(200).json({ firstName, primaryEmail })
return res.status(200).json({ fullName, primaryEmail })
}
```
</CodeBlockTabs>
Expand All @@ -73,14 +73,14 @@ This guide will show you how to customize a session token to include additional
1. Create the `CustomJwtSessionClaims` interface and declare it globally.
1. Add the custom claims to the `CustomJwtSessionClaims` interface.

The following example demonstrates how to add the `firstName` and `primaryEmail` claims to the `CustomJwtSessionClaims` interface.
The following example demonstrates how to add the `fullName` and `primaryEmail` claims to the `CustomJwtSessionClaims` interface.

```tsx {{ filename: 'types/globals.d.ts' }}
export {}

declare global {
interface CustomJwtSessionClaims {
firstName?: string
fullName?: string
primaryEmail?: string
}
}
Expand Down

0 comments on commit ff3c224

Please sign in to comment.