util.jwtVerify()
Verifies a JWT.
Signature
static jwtVerify(
token: string,
secret: string | { key: string; passphrase: string },
options?: {
algorithms?: (
| 'HS256'
| 'HS384'
| 'HS512'
| 'RS256'
| 'RS384'
| 'RS512'
| 'ES256'
| 'ES384'
| 'ES512'
| 'PS256'
| 'PS384'
| 'PS512'
| 'none'
)[];
audience?: string | RegExp | Array<string | RegExp>;
clockTimestamp?: number;
clockTolerance?: number;
complete?: boolean;
issuer?: string | string[];
ignoreExpiration?: boolean;
ignoreNotBefore?: boolean;
jwtid?: string;
nonce?: string;
subject?: string;
maxAge?: string | number;
allowInvalidAsymmetricKeyTypes?: boolean;
},
): any;
Example
const payload = util.jwtVerify(token, secret);

