Repository navigation
feat(account): continue with Google, and the account's ways to sign in - #3151
Conversation
Settings > Devices and PCs follows WhatsApp's Linked devices: the account on top, then My devices, one list of this PC (with its relay ID), the other PCs (and, signed in, the account's) and the paired phones and browsers, each with a kind pill. One Connect button opens Connect a device: signed in with this PC in the account and the relay online, the new device signs in and is approved once on a device already in the account; otherwise the relay's QR code and the code to type side by side with Refresh and Copy. Same Wi-Fi, Tailscale, Portal and Add a PC over SSH fold under Other ways to connect. Keep screen on, Install, the relay's switch and identity reset, Show in sidebar and Access move to More settings. The PC's ID moves out of the dialog to the top of My devices, and the typed-code confirmation points there. Old section links (phone, remote, portal) land on My devices.
…de across openings - Connect a device offers joining by signing in only when this PC belongs to the account this browser is signed in to, read again each time the dialog opens. - The relay's code to type is shown again while it lasts instead of minted on every opening (each mint starts a pairing code, ten allowed in ten minutes); one that arrives already expired says so and waits for Refresh. - A watching device is offered no Same Wi-Fi code. - Confirmations sit above Settings raised over a file preview and above Connect a device. - ui-regression signs out with Sign out of this PC; device-security compares frames only on a page that scrolls.
# Conflicts: # DESIGN.md # src/components/SettingsDialog.tsx # src/lib/paletteSettings.ts
Adds Google as its own sign-in method next to GitHub in every sign-in place: the desktop app (loopback), a PC's own page (Google's device flow, linked only to google.com/device) and the app.ovis.sh shell. A button shows only for providers the service lists at GET /v1/providers. Settings > Devices and PCs > Account lists the account's sign-in methods (GET /v1/identities), adds one on purpose with a one-time link token and removes any but the one this device signed in with. No account is joined by matching email. docs/account.md holds the contract for the service.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
… the code Review findings on #3151: - a link commits at /v1/token only, redeemed with the PKCE verifier and the linking account's Bearer token; starting a sign-in links nothing - an unknown, spent or expired link token answers error=invalid_link and never falls back to a plain sign-in - addMethod refuses (and ends) an answer for another account, keeping the session it had - the device flow never links: methods are added from the desktop app - the nonce check applies to Google's redirect sign-in only
|
@coderabbitai review |
Action not completed
|
… while its sign-in is current - GET /v1/identities lists provider and added_at only; Settings shows the provider and when it was added - Google asks for openid only - a link code is redeemed by the same sign-in that got the link token; adding or removing a method needs a sign-in from the last 10 minutes (403 reauth_required), and Settings asks to sign in again, then repeats - a linking sign-in is not stored by finishSignIn; addMethod keeps it under the session lock only while the sign-in that asked is current, and ends it when the account was signed out meanwhile
# Conflicts: # DESIGN.md # scripts/settings-pages-demo-regression.ts # src/components/AccountSection.tsx # src/components/ConnectPhoneDialog.tsx # src/components/DevicesPanel.tsx # src/components/RelayPanel.tsx # src/components/SettingsDialog.tsx # src/lib/i18n.ja.ts # src/lib/i18n.ko.ts # src/lib/i18n.zh.ts # src/lib/i18n/devices.ja.ts # src/lib/i18n/devices.ko.ts # src/lib/i18n/devices.zh.ts # src/lib/i18n/settings-access.ja.ts # src/lib/i18n/settings-access.ko.ts # src/lib/i18n/settings-access.zh.ts
Review findings and resolutions (CodeRabbit rate-limited, no review of this head)This PR changes authentication (Google sign-in, adding and removing sign-in methods). CodeRabbit did not review head f3b0178, so the code-review agents' findings stand in for it: Round 1 (omo BLOCK at an earlier head), fixed in 2b6056a:
Merge pass's own strict review (Codex Terra xhigh) at 2b6056a: one MEDIUM, reproduced with the fake service: a pending "add Google" link could restore a live session after sign-out. Fixed in d0828f4 (failing-first test): This round also adopts the service contract: identities without labels, Delta review at f3b0178: no HIGH. Two MEDIUMs, reproduced with the fake service, share one fix and are filed as #3164 (this PR's extra round is used): re-authentication racing a sign-out in another tab can restore a session and still apply the queued method change; and link cleanup after sign-out treats a failed revoke (429/5xx) as success, leaving the discarded refresh token live. Unresolved review threads: 0. omo receipt: CLEAR at this head. |
|
Merge note (merge pass) at head f3b0178:
|
What
Continue with Google next to GitHub sign-in, plus the account's sign-in methods in Settings.
(Google's device flow; the page links only to
https://www.google.com/device), the app.ovis.shshell (redirect), and phones through the existing
ovis://account/callbacksheet.GET /v1/providers. A servicethat cannot answer keeps the build's own list (GitHub alone by default), so no Google button
shows until the service is set up for it.
GET /v1/identities), adds amethod on purpose (
POST /v1/identities/link→ one-timelink_token→ that provider's normalsign-in), and removes any method except the one this device signed in with (the service refuses
the last one,
last_identity). The account row names the provider ("Signed in with Google").another account fails with
identity_in_use, and neither account changes."Continue with Google", on the same black/white button as GitHub and Apple (Google's dark and
light button styles).
The contract for the private account service is in
docs/account.md(Signing in → providers,Google device flow, Sign-in methods). The service lane (google-signin-service) implements it.
shared/account-service-fake.tsimplements it for tests.Design follows the sign-in options in the ChatGPT/Codex and Claude apps: separate provider buttons,
linked methods managed from account settings, and no linking by email.
Stacked on #3148 (Devices and PCs page); base is
feat/devices-page-groups.Native apps
No native code changes: Google goes through the same
OvisAuth.authenticatesystem sheet(ASWebAuthenticationSession / Custom Tabs, which Google allows) as GitHub. Phones get the Google
button with their next app build that bundles this web code.
Validation
src/lib/account/methods.test.ts(providerdiscovery and fallback, Google redirect and device sign-in, add/remove methods,
identity_in_use).bun test src/lib/account shared/account-service-fake.test.ts src/lib/i18n.test.ts src/conventions.test.ts scripts/conventions.test.ts scripts/shell-build.test.ts app/electron/src/accountSignIn.test.ts src/components: 527 pass.bun run typecheck: clean.bun scripts/settings-pages-demo-regression.ts: all PASS, including the newaccountGooglestep (Google button only while offered, four-colour G, methods list with Remove) at 390 and 1280px.
bun run check fast(local, P620 under 85% CPU): typecheck, build, unit 12652 pass / 0 fail, generated files fresh.