fix(auth): Revoke all workspace sessions on logout #8288
+34
−9
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.
Updates logout behavior to revoke all web session tokens for a workspace (not just the current session) and hides web session tokens from the API Tokens management page. Fixes multi-session logout behavior where users expect "logout" to end all active sessions for a workspace, not just the current tab.
With the initial secure bearer tokens implementation:
Logout Now Revokes All Sessions
When a user logs out from a workspace:
Why this is correct:
Multi-Session Behavior
During Active Use (Multiple Tabs):
Tab 1: Working in workspace
Tab 2: Click workspace link
→ New token created for Tab 2
→ Tab 1's token NOT revoked
→ Both tabs work independently ✅
On Logout (Global Termination):
Tab 1: Clicks logout
→ All web tokens for user+workspace revoked
→ Tab 1 redirects to login
→ Tab 2 next request → 401
→ Tab 2 auto-logout via 401 interceptor
→ Clean session end across all tabs ✅
Token Accumulation
Multiple sessions are allowed and expected:
This is NOT a security issue because: