Module: jwt
Functionsβ
decodeβ
βΈ decode(params
): Promise
<JWT
| null
>
Decodes a NextAuth.js issued JWT.
Parametersβ
Name | Type |
---|---|
params | JWTDecodeParams |
Returnsβ
Promise
<JWT
| null
>
encodeβ
βΈ encode(params
): Promise
<string
>
Issues a JWT. By default, the JWT is encrypted using "A256GCM".
Parametersβ
Name | Type |
---|---|
params | JWTEncodeParams |
Returnsβ
Promise
<string
>
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
>
Interfacesβ
JWTβ
β’ JWT: Object
Returned by the jwt
callback and getToken
, when using JWT sessions