Function: getToken
jwt.getToken
â–¸ getToken<R>(params): Promise<R extends true ? string : JWT | null>
Takes a NextAuth.js request (req) and returns either the NextAuth.js issued JWT's payload,
or the raw JWT string. We look for the JWT in the either the cookies, or the Authorization header.
Documentation
Type parameters​
| Name | Type |
|---|---|
R | extends boolean = false |
Parameters​
| Name | Type |
|---|---|
params | GetTokenParams<R> |
Returns​
Promise<R extends true ? string : JWT | null>