Repository navigation
feat: sign out that actually ends the session - #297
Merged
Merged
Conversation
`user.signOut` only cleared a `lapse-auth` cookie we no longer use, and nothing in the UI called it - the bearer token in localStorage stayed valid for up to 30 days. - Server: revoke the caller's access token via a Redis denylist keyed by the token's SHA-256, expiring when the JWT would. Checked in both `getAuthenticatedUser` and the OAuth model. - Client: forget account-scoped local state (token, caches, Lookout session tokens, auth sessionStorage) while keeping device-level OPFS data, then do a full navigation so no in-memory state survives. Other open tabs follow along via the `storage` event. - UI: "Sign out" in Settings with a confirmation dialog that reassures about unpublished recordings and offers a local-only fallback if the server can't be reached. The mobile "You" button now opens Settings, so sign out is reachable there too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
user.signOutonly deleted alapse-authcookie the client doesn't use (auth is a bearer token inlocalStorage), and nothing in the UI called it. There was no way to sign out, and even calling the endpoint left the JWT valid for up to 30 days.Changes
Server
revokeAccessTokenadds the token's SHA-256 to a Redis denylist with a TTL matching the JWT's remaining lifetime. Hashing it means a Redis dump doesn't expose live credentials, and the TTL keeps the denylist bounded.getAuthenticatedUserand the OAuth model'sgetAccessToken.user.signOutrevokes the calling token and returns an error if Redis fails, so the client never believes it's signed out when it isn't. It still clears the legacy cookie.Client
signOutclears account-scoped state: the token,lapse:cache.*, Lookout session tokens, andlapse:*sessionStorage. It deliberately keeps the OPFS device store, which holds legacy encryption keys and unrecovered recordings.location.replace("/")so no in-memory state survives.storageevent.SignOutModal, opened from a "Sign out" entry in Settings:Verification
tsc --noEmitpasses for the server.@lookout/reactand generated build info.🤖 Generated with Claude Code