Files
jose/docs/util/errors/interfaces/JWTClaimValidationFailure.md
Filip Skokan abec502715 refactor(types): add discriminated JOSE error types
Pair each JOSE error subclass with its stable code so code switches can
narrow safely without closing subclass code values.

Share typed causes and reasons across JWT claim-validation errors, and
make consumer-created multiple-match errors safely iterable. Add
compile-time coverage for the public type surface.

Signed-off-by: Filip Skokan <[email protected]>
2026-07-29 18:50:54 +02:00

1.0 KiB

Interface: JWTClaimValidationFailure

💗 Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.

The shape shared by the two errors thrown during JWT Claims Set validation.

Note

JWTExpired does not extend JWTClaimValidationFailed, so instanceof JWTClaimValidationFailed is false for an expired JWT. Use JWTClaimValidationError or the code discriminant to handle both.

Properties

claim

• claim: string

The Claim for which the validation failed.


payload

• payload: JWTPayload

The parsed JWT Claims Set (aka payload).


reason

• reason: string

Reason code for the validation failure.