Skip to content

fix: add proper error handling in token expiration check#50

Open
Chandraveersingh1717 wants to merge 1 commit intometacall:masterfrom
Chandraveersingh1717:fix-token-validation
Open

fix: add proper error handling in token expiration check#50
Chandraveersingh1717 wants to merge 1 commit intometacall:masterfrom
Chandraveersingh1717:fix-token-validation

Conversation

@Chandraveersingh1717
Copy link

Fix token validation bug in expiresIn function

The expiresIn function was returning 0 for invalid tokens instead of throwing errors. This adds proper validation and error handling.

Changes:

  • Validate token input before decoding
  • Throw descriptive errors for invalid/malformed tokens
  • Simplify the expiration calculation
  • Add unit tests for token validation

Tests: 5 new tests added, all passing

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.

1 participant