Repository navigation
[DevOps]: Extend browser login lifetime to 7 days - #500
Merged
tomvothecoder merged 3 commits intoNov 17, 2026
Merged
Conversation
The JWT lifetime was hardcoded to 1 hour and ignored config. Derive it from cookie_max_age so token and cookie expire together, drop the unused lifetime_seconds setting, and default to 7 days.
Raise COOKIE_MAX_AGE to 604800 in compose and env examples, and document in the NERSC Spin runbook how to revoke one user's or all browser sessions.
Password-login bearer JWTs shared the browser strategy and would have inherited the 7-day COOKIE_MAX_AGE. Give them their own 1-hour strategy. Make runbook revocation steps directly actionable.
tomvothecoder
marked this pull request as ready for review
November 17, 2026 21:48
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.
Description
Browser logins expired after 1 hour because the JWT lifetime was hardcoded to
3600and ignored config.COOKIE_MAX_AGE, which defaults to 7 days (604800). I removed the unusedlifetime_secondssetting./auth/jwt/login) keep a fixed 1-hour lifetime because they carry superuser privileges.604800. The runbook now documents how to revoke access for one user or end all browser sessions.Approach: fixed lifetime on stateless JWTs. Sliding refresh and server-side sessions were left out on purpose. Revisit them, using fastapi-users
DatabaseStrategy, if we need per-user session revocation or SimBoard starts holding sensitive data.Validation:
make backend-test: 2561 passed, 26 skippedmake pre-commit-run: all hooks passedCOOKIE_MAX_AGE; bearer JWT lifetime stays at 1 hourRisks:
Checklist
Deployment Notes (if any)
COOKIE_MAX_AGE=604800in thesimboard-backend-envsecret and redeploy the backend. Until then, the deployed value (3600) keeps the 1-hour lifetime.