const profile = defineProfile({
typ: "at+jwt",
issuer: "https://auth.example.com",
audience: "https://api.example.com",
algorithms: ["EdDSA"],
keys: createRemoteJWKSet("https://auth.example.com/jwks"),
maxTokenAge: "10m",
});
const { payload } = await jwtVerify(token, profile); // every check passed
Verify a token against a profile. The returned VerifiedJwt is the only way to obtain one - there is no backdoor.
On any failure it throws a JWTError (
JWT_EXPIRED,ALGORITHM_NOT_ALLOWED,JWT_CLAIM_VALIDATION_FAILED, ...) and yields no partial result. There is nodecode()and noignoreExpiration.