Skip to content

fix(auth): keep session when server is unreachable on startup - #37

Open
Beta-Blaze wants to merge 1 commit into
Termix-SSH:mainfrom
Beta-Blaze:fix/persist-session-on-restart
Open

fix(auth): keep session when server is unreachable on startup#37
Beta-Blaze wants to merge 1 commit into
Termix-SSH:mainfrom
Beta-Blaze:fix/persist-session-on-restart

Conversation

@Beta-Blaze

Copy link
Copy Markdown

Overview

App logged the user out on restart whenever the token check failed for any reason, including a network blip.

  • Fixed: session no longer dropped when the server is unreachable at startup

Changes Made

  • AppContext.tsx: startup auth probe now only clears the JWT on a 401. Any other failure (offline, 502, timeout) keeps the session and the app retries on the next request. The existing 401 interceptor still signs out if the token really is bad.
  • Removed the data_unlocked check from the startup and foreground auth checks. It gates encrypted data, not login state, so a locked vault was treated as "not logged in".
  • The server URL was never actually cleared. Losing the session dropped users into the auth flow, which starts on the server URL step, so it looked like the whole config was gone.

Related Issues

Screenshots / Demos

Tested on a release build: sign in, force close, reopen, still signed in. Used to log out every time.

Checklist

  • Code follows project style guidelines
  • Supports mobile and desktop UI/app (if applicable)
  • I have read Contributing.md

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.

[BUG] Session/login data lost after App Lock / after some time – forced to re-enter server URL, credentials and 2FA

1 participant