Token now expires after 12h#63
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request extends the authentication token and session expiry from 6 hours to 12 hours across both the backend and frontend. It also improves how the frontend parses and synchronizes token expiry, ensuring consistency between the backend JWT and frontend session handling.
Backend expiry updates:
TokenService(apps/backend/src/modules/auth/token.service.ts).mysagra_tokencookie'smaxAgeto 12 hours in theAuthController(apps/backend/src/modules/auth/auth.controller.ts).Frontend expiry handling and synchronization:
parseTokenExpiryfunction inauth.tsto extract the expiry from the JWT and use it for setting the cookie'smaxAge, ensuring the frontend cookie matches the backend token's expiry (apps/frontend/lib/auth.ts). [1] [2]maxAgevalues to 12 hours to match the backend, and propagated the token expiry throughout the authentication flow (apps/frontend/lib/auth.ts). [1] [2]exp) is included in the JWT and session objects for consistent expiry tracking on the frontend (apps/frontend/lib/auth.ts). [1] [2]