Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Mention context param for generateJWT #416

Merged
merged 1 commit into from
May 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/app/connect/auth/frameworks/next/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,17 @@ export async function logout() {
}
```

You can include custom context in the JWT token with the `context` parameter:

```ts
const jwt = await thirdwebAuth.generateJWT({
payload: verifiedPayload.payload,
context: {
admin: true,
},
});
```

Now anywhere in your project, you can check a user's authentication status:

```tsx
Expand Down
Loading