Repository navigation
Conversation
The browser page the desktop app opens (/login?client_id=electron...) only offered handing the web session to the desktop app or switching accounts. A signed-in user who would rather keep using Lody on the web had no way out: leaving meant closing the tab, and navigating back could re-arm the automatic deep link. The handoff panel gains a secondary "Use in web browser" button between the desktop action and "Use a different account". It bumps the account generation like an account switch, so a transfer in flight is discarded instead of opening the desktop app after the choice, then follows the page's ordinary authenticated redirect - the validated redirect target or the app root - through window.location.replace, which keeps the handoff page out of history. Transfer, auto-open and switch-account behavior is unchanged. Generated with [Devin](https://devin.ai) Model: SWE-2 Max Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Leeeon233
marked this pull request as ready for review
November 20, 2026 09:10
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Generated with [Devin](https://devin.ai) Model: SWE-2 Max Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This branch has not been deployed
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.
Related issue
Problem / pressure
The browser page the desktop app opens for sign-in (
/login?client_id=electron&state=…&code_challenge=…) offered only two exits: hand the browser session to the desktop app, or sign out to switch accounts. A user already signed in who would rather keep using Lody on the web had no way out — leaving meant closing the tab, and navigating Back could re-arm the automaticlody://deep link.Summary
better-auth.electroncookie cleared — so an in-flightelectron.transferUseris discarded instead of minting a handoff link or auto-openinglody://after the user chose the web.prepareAuthenticatedRedirect→replaceLocation(getRedirectTarget())): login-hint cookie plus native session sync where needed, thenwindow.location.replaceto the validatedredirecttarget or the app root. The existing browser session carries the user into the web app, andreplacekeeps the handoff page out of history so Back cannot re-arm the deep link.login.desktopHandoff.useWebinen.json("Continue in browser") andzh_CN.json("在 Web 浏览器中使用"). Owning decision note updated in both languages.Visual explanation
Test plan
tests/electron-browser-login-handoff.test.tsxextended, 15 tests pass:replaceLocation("/")without callingtransferUser;lody://navigation.pnpm check(typecheck + all test suites) passed;pnpm format;pnpm run docs checkpassed./login?client_id=electron&…while signed in → 在 Web 浏览器中使用 → web workspace).Generated with Devin