Skip to main content

Function: verifyJwt()

verifyJwt(args): JwtPayload | null

Defined in: auth-core/src/jwt.ts:164

Verifies a JWT's signature and expiration — HS256 against a secret, or EdDSA / ES256 against a jwks. Each mode accepts only its own algorithms, so an HS256 token never passes a JWKS check or vice versa.

Returns the payload when the token is valid, or null when the token is malformed, has an invalid signature, names an unknown kid, or is expired.

Parameters​

ParameterType
argsobject & JwtVerificationKeyArgs

Returns​

JwtPayload | null