| 36 | } |
| 37 | |
| 38 | export interface GetTokenParams<R extends boolean = false> { |
| 39 | /** The request containing the JWT either in the cookies or in the `Authorization` header. */ |
| 40 | req: NextApiRequest | Pick<NextApiRequest, "cookies" | "headers"> |
| 41 | /** |
| 42 | * Use secure prefix for cookie name, unless URL in `NEXTAUTH_URL` is http:// |
| 43 | * or not set (e.g. development or test instance) case use unprefixed name |
| 44 | */ |
| 45 | secureCookie?: boolean |
| 46 | /** If the JWT is in the cookie, what name `getToken()` should look for. */ |
| 47 | cookieName?: string |
| 48 | /** |
| 49 | * `getToken()` will return the raw JWT if this is set to `true` |
| 50 | * @default false |
| 51 | */ |
| 52 | raw?: R |
| 53 | /** |
| 54 | * The same `secret` used in the `NextAuth` configuration. |
| 55 | * Defaults to the `NEXTAUTH_SECRET` environment variable. |
| 56 | */ |
| 57 | secret?: string |
| 58 | decode?: JWTOptions["decode"] |
| 59 | logger?: LoggerInstance | Console |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Takes a NextAuth.js request (`req`) and returns either the NextAuth.js issued JWT's payload, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…