You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web token auto-refresh broken on http (non-secure-context) deployments — forces re-login every access_token_duration instead of refresh_token_duration #21575
When Bytebase is accessed over plain HTTP (non-secure context, e.g. http://:8080 or behind an http-only reverse proxy), the web token auto-refresh is completely broken. After the access token expires, the client fails to refresh it and the user is forced to re-authenticate every access_token_duration (default 1h), instead of being transparently refreshed until refresh_token_duration (default 7d). Operators currently work around this by inflating access_token_duration, which weakens security (long-lived, non-revocable JWTs).
Root cause: frontend/src/connect/refreshToken.ts calls navigator.locks.request(...) unconditionally. navigator.locks (Web Locks API) only exists in secure contexts (HTTPS or localhost); on a plain-http origin it is undefined, so the call throws and refreshTokens() rejects, causing authInterceptor to treat refresh as failed and log the user out. The refresh-token cookie transport itself is fine (backend sets Secure=false on http).
Steps to reproduce
Run/access the Bytebase web UI via http:// (e.g. http://10.0.0.1:8080, not https and not localhost).
Log in.
Wait longer than access_token_duration without logging out (or set access_token_duration shorter to reproduce faster).
Perform any action in the UI.
Expected behavior
The access token expires after access_token_duration and is transparently refreshed using the refresh token, so the user stays signed in. A full re-authentication should only be required when the refresh token expires (refresh_token_duration, default 7d) or when inactive_session_timeout triggers — not on every access_token_duration.
Activity