MCPcopy
hub / github.com/nextauthjs/next-auth / GetTokenParams

Interface GetTokenParams

src/jwt/index.ts:38–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38export 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,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…