Skip to content

fix(desktop): restore T3 Connect sign-in - #4809

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
PixPMusic:fix/desktop-connect-auth-redirect
Jul 29, 2026
Merged

fix(desktop): restore T3 Connect sign-in#4809
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
PixPMusic:fix/desktop-connect-auth-redirect

Conversation

@PixPMusic

@PixPMusic PixPMusic commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Normalize Electron Clerk sign-in redirects to the registered renderer root.
  • Preserve the full current URL for hosted web and CLI authorization flows.
  • Share the redirect policy across T3 Connect sign-in entry points.
  • Add focused coverage for packaged desktop, desktop development, and hosted web URLs.

Why

The Connect GA change forced window.location.href as the post-auth redirect. During desktop authentication Clerk uses /continue, which produced t3code://app/continue#/settings/general. Clerk only authorizes the Electron bridge callback at t3code://app/, so both stable 0.30 and Nightly rejected the sign-in request.

Using the stable renderer root on Electron keeps the request aligned with the native redirect allowlist while leaving browser redirects unchanged.

User impact

Desktop users can sign in to T3 Connect again in stable and Nightly builds without receiving an unauthorized redirect URI error.

Validation

  • vp test run src/components/clerk/authRedirect.test.ts --project unit — 3 tests passed
  • Targeted formatting and lint passed for all changed files
  • vp run --filter @t3tools/web typecheck passed
  • git diff --check passed

UI changes

No screenshots included. This changes the native authentication redirect rather than rendered UI, and the production Clerk flow was not launched during this pass.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I added regression coverage

Model: GPT-5.6 Sol | Harness: Codex in T3 Code


Note

Medium Risk
Touches authentication redirect behavior on Electron and web; incorrect policy could break sign-in or post-auth navigation, but scope is small and covered by targeted tests.

Overview
Fixes desktop T3 Connect sign-in failures caused by passing forceRedirectUrl: window.location.href into Clerk. On Electron, page-derived URLs (paths, hashes, or /continue handoff URLs) fall outside Clerk’s native allowlist, which only accepts the renderer root t3code://app/ (or t3code-dev://app/ in dev).

Introduces resolveClerkSignInProps, which returns an empty props object on Electron so Clerk/@clerk/electron use their default OAuth redirect, and still sets forceRedirectUrl to the full current URL on hosted web.

useT3ConnectAuthPrompt and ConnectCliAuthSurface (auto sign-in and the Sign in button) now call openSignIn through that helper. Unit tests cover web, packaged desktop, and dev desktop cases.

Reviewed by Cursor Bugbot for commit e2dd22b. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix T3 Connect sign-in redirect on desktop by skipping forceRedirectUrl under Electron

Introduces a resolveClerkSignInProps utility in authRedirect.ts that returns {} when running under Electron and {forceRedirectUrl: href} on web. Updates useT3ConnectAuthPrompt.tsx and ConnectCliAuthSurface.tsx to use this resolver instead of unconditionally setting forceRedirectUrl, fixing the broken sign-in flow in the desktop app.

Macroscope summarized e2dd22b.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b6e31b7e-b822-4232-bdc0-dafc5ac7447f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jul 29, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved e2dd22b

Straightforward bug fix that restores desktop sign-in by conditionally omitting a Clerk redirect parameter that's incompatible with Electron's OAuth allowlist. The change is small, well-documented, and includes tests.

You can customize Macroscope's approvability policy. Learn more.

…malizing it

The pre-GA flow signed in with Clerk's default redirects and worked; the GA
change broke desktop by forcing window.location.href, whose page-derived URL
fails Clerk's native redirect allowlist. Rather than passing a normalized
root URL, drop the override entirely on Electron so the sign-in request is
identical to the previously working configuration — @clerk/electron's OAuth
transport already supplies the allowlisted t3code://app/ callback. Browser
flows keep returning to the exact page that started auth.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Pushed e2dd22b, which changes the approach: instead of normalizing forceRedirectUrl to the scheme root on Electron, we now omit the override entirely there (openSignIn() with Clerk defaults), which is exactly the configuration the pre-GA waitlist-era sign-in used — and that flow worked on desktop.

Rationale: the URL Clerk rejected in #4815 (t3code://app/CLERK-ROUTER/VIRTUAL/sign-up#/settings/general) is not the forceRedirectUrl — it's built by Clerk's modal virtual router from window.location.origin, so normalizing the override can't be shown to fix the Google flow. Reverting to defaults sidesteps the question: @clerk/electron's OAuth transport already substitutes the allowlisted t3code://app/ callback for the OAuth leg, and with no page-derived override in the request we match the previously working behavior instead of guessing at the allowlist's matching rules. Browser/CLI flows still get forceRedirectUrl: window.location.href unchanged.

Validation: helper unit tests (3 passed), @t3tools/web typecheck, vp fmt. The production Clerk flow still hasn't been exercised end-to-end — worth a packaged-build Google sign-in check before release. Note #4815 also reports the Linux AppImage never registers the t3code:// scheme handler; that's a separate packaging fix this PR doesn't cover.

@juliusmarminge
juliusmarminge merged commit 1b4830f into pingdotgg:main Jul 29, 2026
17 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Jul 29, 2026
ohbentos pushed a commit to ohbentos/t3code that referenced this pull request Jul 29, 2026
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Jul 29, 2026
## What's Changed
* Fix Connect sign-in settings label by @juliusmarminge in pingdotgg/t3code#4806
* fix(desktop): restore T3 Connect sign-in by @PixPMusic in pingdotgg/t3code#4809
* Simplify files panel header by @juliusmarminge in pingdotgg/t3code#4828
* build(desktop): reduce installed app size by ~300MB by @wukko in pingdotgg/t3code#4824
* Update model version from claude-opus-4-8 to claude-opus-5 by @juliusmarminge in pingdotgg/t3code#4832
* Preserve the thread shell while detail loads by @juliusmarminge in pingdotgg/t3code#4830
* Reduce idle work and disk churn with native resource diagnostics by @juliusmarminge in pingdotgg/t3code#2679
* fix(server): detect repositories after initialization by @StiensWout in pingdotgg/t3code#4848
* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat by @UtkarshUsername in pingdotgg/t3code#4843
* fix(git): disable external diff for review diff previews by @ohbentos in pingdotgg/t3code#4854
* Fix editable file focus and live syntax highlighting by @jakeleventhal in pingdotgg/t3code#3979
* fix(web): remember the rendered-markdown choice across threads by @Sy-D in pingdotgg/t3code#4853

## New Contributors
* @wukko made their first contribution in pingdotgg/t3code#4824
* @ohbentos made their first contribution in pingdotgg/t3code#4854
* @Sy-D made their first contribution in pingdotgg/t3code#4853

**Full Changelog**: pingdotgg/t3code@v0.0.30...v0.0.31

## What's Changed
* Fix Connect sign-in settings label by @juliusmarminge in pingdotgg/t3code#4806
* fix(desktop): restore T3 Connect sign-in by @PixPMusic in pingdotgg/t3code#4809
* Simplify files panel header by @juliusmarminge in pingdotgg/t3code#4828
* build(desktop): reduce installed app size by ~300MB by @wukko in pingdotgg/t3code#4824
* Update model version from claude-opus-4-8 to claude-opus-5 by @juliusmarminge in pingdotgg/t3code#4832
* Preserve the thread shell while detail loads by @juliusmarminge in pingdotgg/t3code#4830
* Reduce idle work and disk churn with native resource diagnostics by @juliusmarminge in pingdotgg/t3code#2679
* fix(server): detect repositories after initialization by @StiensWout in pingdotgg/t3code#4848
* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat by @UtkarshUsername in pingdotgg/t3code#4843
* fix(git): disable external diff for review diff previews by @ohbentos in pingdotgg/t3code#4854
* Fix editable file focus and live syntax highlighting by @jakeleventhal in pingdotgg/t3code#3979
* fix(web): remember the rendered-markdown choice across threads by @Sy-D in pingdotgg/t3code#4853

## New Contributors
* @wukko made their first contribution in pingdotgg/t3code#4824
* @ohbentos made their first contribution in pingdotgg/t3code#4854
* @Sy-D made their first contribution in pingdotgg/t3code#4853

**Full Changelog**: pingdotgg/t3code@v0.0.30...v0.0.31

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.31
tarik02 added a commit to tarik02/t3code that referenced this pull request Jul 30, 2026
* fix(desktop): restore T3 Connect sign-in (pingdotgg#4809)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* Simplify files panel header (pingdotgg#4828)

* build(desktop): reduce installed app size by ~300MB (pingdotgg#4824)

* Update model version from claude-opus-4-8 to claude-opus-5 (pingdotgg#4832)

* Preserve the thread shell while detail loads (pingdotgg#4830)

* Reduce idle work and disk churn with native resource diagnostics (pingdotgg#2679)

Co-authored-by: codex <codex@users.noreply.github.com>

* fix(server): detect repositories after initialization (pingdotgg#4848)

* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat (pingdotgg#4843)

* fix(git): disable external diff for review diff previews (pingdotgg#4854)

* Fix editable file focus and live syntax highlighting (pingdotgg#3979)

* fix(web): remember the rendered-markdown choice across threads (pingdotgg#4853)

Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

* chore(release): prepare v0.0.31

* fix(mobile): reduce thread feed scroll jank (pingdotgg#4874)

* fix(web): restore sidebar v2 thread actions and terminal icon (pingdotgg#4712)

* fix(web): settle button now works on hover, not just right-click (pingdotgg#4905)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(clients): disable add project while disconnected (pingdotgg#4834)

* fix(composer): hide default Codex service tier (pingdotgg#4784)

* docs: link iOS and Android app store downloads (pingdotgg#4902)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): align remote server update action (pingdotgg#4731)

* fix(connect): suggest a serve command that matches how you ran connect (pingdotgg#4897)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): stop shared content errors in Personal Team builds (pingdotgg#4943)

* perf(mobile): sends respond instantly, thread opens stop freezing (pingdotgg#4882)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): show Codex fast mode as a bolt (pingdotgg#4947)

* docs: seed worktrees with a copy of real userdata instead of banning it (pingdotgg#4949)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): support dragged images in the composer (pingdotgg#4953)

* fix(mobile): stop long iOS threads from jumping while scrolling up (pingdotgg#4867)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): keep worktree default when switching a draft's machine (pingdotgg#4964)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* perf(mobile): reconnect environments immediately on resume (pingdotgg#4878)

* feat(web): pasting a huge screenshot now compresses it instead of erroring (pingdotgg#4967)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* feat(web): regenerate thread titles from sidebar (pingdotgg#4810)

* fix(web): show server update progress through reconnect (pingdotgg#4903)

---------

Co-authored-by: Alex <me@pixp.cc>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: wukko <me@wukko.me>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: ohbentos <72638975+ohbentos@users.noreply.github.com>
Co-authored-by: Jake Leventhal <jakeleventhal@me.com>
Co-authored-by: Simon Doba <simon.doba@hotmail.de>
Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Gabriel De Andrade <30420087+gabrielelpidio@users.noreply.github.com>
Co-authored-by: Jono Kemball <Noojuno@users.noreply.github.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Max Katz <me@maxkatz.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants