feat: keep session alive on Admin ( M2 - 11001 ) - #2246
Open
sricharan-varanasi wants to merge 5 commits into
Open
feat: keep session alive on Admin ( M2 - 11001 )#2246sricharan-varanasi wants to merge 5 commits into
sricharan-varanasi wants to merge 5 commits into
Conversation
sricharan-varanasi
force-pushed
the
session-keep-alive
branch
from
July 31, 2026 16:45
6ef6462 to
f9ed2be
Compare
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
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.
fixorfeaturebranches intodeveloporreleasebranches viaSquash and Merge(to keep clean history)📝 Description
🔗 Jira Ticket M2-11001
Admin only refreshes its access token reactively today, when a request happens to fail with 401. Once the backend switches web/admin to short-lived tokens, an active user who isn't generating API calls (e.g. typing in a long Builder form) can silently lose their session. There's also no inactivity timeout at all right now.
This adds a background engine, behind a new
enableSessionKeepAliveflag (default off):REACT_APP_IDLE_TIMEOUT_MIN, default 30 min), it logs them out through the existing soft-lock flow - email pre-filled, returned to their page after re-login.With the flag off, nothing changes - no timers, no listeners, no extra requests.
Needs the backend token-rotation work merged to test end-to-end (short-lived, rotating tokens for web/admin). Until that lands, keep this flag off in any shared environment - a backgrounded duplicate tab can otherwise log out a tab you're actively using; that fix is a separate follow-up ticket.
🪤 Peer Testing
Requires setting
enableSessionKeepAlivetotruelocally (LaunchDarkly default isfalse)Set short local values, e.g.
REACT_APP_IDLE_TIMEOUT_MIN=3, and shorten the backend's web/admin token lifetimes.Expected outcome: staying active keeps you logged in past the token's normal lifetime - periodic refresh calls in the network tab, no 401s.
Log in, then leave the tab untouched past the idle timeout.
Expected outcome: automatic logout, landing on the login page with your email pre-filled.
Turn the flag back off and repeat.
Expected outcome: no refresh calls, no logout - identical to today's behavior.
✏️ Notes
Duplicate-tab sync and the warning-before-logout modal are tracked as separate follow-up tickets.