mirror of
https://github.com/hanzoai/jose.git
synced 2026-09-24 17:00:01 +00:00
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]>
1.0 KiB
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 JWTClaimValidationFailedisfalsefor 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.