Skip to content

feat(account): continue with Google, and the account's ways to sign in - #3151

Merged
devswha merged 7 commits into
mainfrom
feat/google-signin
Nov 6, 2026
Merged

devswha merged 7 commits into
mainfrom
feat/google-signin

Conversation

@devswha

@devswha devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner

What

Continue with Google next to GitHub sign-in, plus the account's sign-in methods in Settings.

  • Google is offered in every sign-in place: the desktop app (loopback redirect), a PC's own page
    (Google's device flow; the page links only to https://www.google.com/device), the app.ovis.sh
    shell (redirect), and phones through the existing ovis://account/callback sheet.
  • A button shows only for providers the account service lists at GET /v1/providers. A service
    that 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.
  • Settings → Devices and PCs → Account lists Ways to sign in (GET /v1/identities), adds a
    method on purpose (POST /v1/identities/link → one-time link_token → that provider's normal
    sign-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").
  • Accounts are never joined by matching email. Linking a Google identity that already belongs to
    another account fails with identity_in_use, and neither account changes.
  • Google sign-in follows Google's branding rules: the four-colour "G" (never recoloured) and
    "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.ts implements 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.authenticate system 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

  • Tests written first, failing before the change: src/lib/account/methods.test.ts (provider
    discovery 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 new accountGoogle
    step (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.
  • Not run: full integration/browser suites (CI runs them).

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.
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3962f0f and f3b0178.

Files selected for processing: 25

  • app/electron/src/main.ts
  • changelog.d/google-sign-in.md
  • docs/account.md
  • scripts/settings-pages-demo-regression.ts
  • scripts/shell-build.ts
  • shared/account-service-fake.ts
  • src/components/AccountPcs.css
  • src/components/AccountPcs.tsx
  • src/components/AccountSection.tsx
  • src/lib/account/desktop.ts
  • src/lib/account/deviceSignIn.ts
  • src/lib/account/methods.test.ts
  • src/lib/account/service.ts
  • src/lib/account/signin.ts
  • src/lib/account/store.ts
  • src/lib/i18n.ja.ts
  • src/lib/i18n.ko.ts
  • src/lib/i18n.zh.ts
  • src/lib/i18n/relay.ja.ts
  • src/lib/i18n/relay.ko.ts
  • src/lib/i18n/relay.zh.ts
  • src/lib/i18n/usage.ja.ts
  • src/lib/i18n/usage.ko.ts
  • src/lib/i18n/usage.zh.ts
  • src/lib/relay/shell.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

… 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
@devswha

devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@devswha

devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

CodeRabbit did not review head 2b6056a (review rate limited). The dori review (CLEAR at this head) stands in; round 1 findings and fixes are in commit 2b6056a's message.

Base automatically changed from feat/devices-page-groups to main November 6, 2026 08:58
… 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
@devswha

devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

CodeRabbit did not review head f3b0178 (review rate limited). The dori review is CLEAR at this head; the merge pass's Codex MEDIUM (a link restoring a session after sign-out) is fixed in d0828f4 with a failing-first test.

@devswha

devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

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:

  • A link was committed when the sign-in started. Now a link commits only at /v1/token, redeemed with the PKCE verifier and the linking account's Bearer token; starting a sign-in links nothing.
  • A stale link fell back to a plain sign-in. Now an unknown, spent or expired link token answers invalid_link and never falls back; addMethod refuses an answer for another account and keeps the session it had. The device flow never links.

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): finishSignIn no longer stores a linking sign-in, and addMethod keeps it only while the asking sign-in is still current. Delta-checked at f3b0178: with the token response delayed past sign-out, the store stays empty and the issued access token answers 401.

This round also adopts the service contract: identities without labels, openid only, same-sign-in link redemption, and a 10-minute re-authentication for adding or removing a method. The delta review confirmed stale-session rejection for add/remove, refusal to remove the last method, and spent-link rejection (fake service; the real service is reviewed in its own repository).

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.

@devswha

devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Merge note (merge pass) at head f3b0178:

@devswha
devswha merged commit ade0589 into main Nov 6, 2026
28 checks passed
@devswha
devswha deleted the feat/google-signin branch November 6, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant