Skip to content

feat: expose TOKEN_ERROR_CODES and derive duplicated error code types from it#573

Merged
simoneb merged 7 commits intonearform:masterfrom
wopian:feat/expose-token-error-codes-as-single-source-of-truth
Dec 1, 2025
Merged

feat: expose TOKEN_ERROR_CODES and derive duplicated error code types from it#573
simoneb merged 7 commits intonearform:masterfrom
wopian:feat/expose-token-error-codes-as-single-source-of-truth

Conversation

@wopian
Copy link
Copy Markdown
Contributor

@wopian wopian commented Nov 29, 2025

Closes #572

  • Expose TOKEN_ERROR_CODES so IDEs recognise it as a valid export from fast-jwt
  • Simplify error code types by referencing TOKEN_ERROR_CODES instead of duplicating string literals. Ensures the exported type union (TokenValidationErrorCode) and TokenError class do not accidently have differing values for an error code.

@ilteoood
Copy link
Copy Markdown
Contributor

Could you write a test for it and place it in test/types?

@wopian
Copy link
Copy Markdown
Contributor Author

wopian commented Nov 29, 2025

Added tests for TOKEN_ERROR_CODES and some sanity type checks to check it is equivalent to the TokenError class usage.

@simoneb simoneb requested a review from SociableSteve December 1, 2025 10:00
@simoneb simoneb merged commit e8429c6 into nearform:master Dec 1, 2025
7 checks passed
@wopian wopian deleted the feat/expose-token-error-codes-as-single-source-of-truth branch December 3, 2025 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing types for TOKEN_ERROR_CODES

4 participants