Skip to content

fix(web): preserve desktop route during Clerk auth - #5770

Merged
juliusmarminge merged 6 commits into
pingdotgg:mainfrom
wobsoriano:fix/electron-auth-redirect
Aug 9, 2026
Merged

fix(web): preserve desktop route during Clerk auth#5770
juliusmarminge merged 6 commits into
pingdotgg:mainfrom
wobsoriano:fix/electron-auth-redirect

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What Changed

Normalize Electron Clerk redirect URLs to the renderer root pathname while preserving T3’s hash route. Use the normalized destination for both sign-in and sign-up.

Why

Clerk’s modal can leave the Electron renderer on an internal virtual pathname. Reusing that URL causes native redirect validation to fail. Electron uses hash routing, so resetting the pathname repairs the URL without losing the current T3 page.

We'll follow up a fix from our side 👍🏼

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Small, test-covered change to Clerk redirect URL construction on desktop only; no changes to web auth or server-side logic.

Overview
Desktop Clerk sign-in/sign-up no longer skips redirect props on Electron. resolveClerkSignInProps now normalizes the current window.location.href by clearing Clerk’s virtual pathname and query string while keeping the hash route (e.g. #/settings/connections), then sets forceRedirectUrl and signUpForceRedirectUrl to that URL.

Web behavior is unchanged: it still passes the full href as forceRedirectUrl only.

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

Note

Preserve desktop hash route in Clerk auth redirect URLs for Electron

In Electron, resolveClerkSignInProps previously returned an empty object, skipping redirect overrides. It now returns forceRedirectUrl and signUpForceRedirectUrl set to a cleaned URL (pathname reset to /, query params cleared) while preserving the hash-based desktop route. Non-Electron behavior is unchanged.

Macroscope summarized a70cd1a.

@coderabbitai

coderabbitai Bot commented Aug 9, 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: 8876525f-41de-49b4-bf15-a3dec8bcc0e6

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 Aug 9, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR modifies authentication redirect logic in the Clerk auth integration (components/clerk/). Changes to auth-related code paths are treated as sensitive and warrant human review, even when the fix appears targeted and includes test coverage.

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

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 9, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 9, 2026 01:45

Dismissing prior approval to re-evaluate 3301d07

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 9, 2026
@wobsoriano
wobsoriano marked this pull request as draft August 9, 2026 02:15
@wobsoriano wobsoriano changed the title fix(web): redirect desktop auth to renderer root fix(web): preserve desktop route during Clerk auth Aug 9, 2026
@wobsoriano
wobsoriano marked this pull request as ready for review August 9, 2026 03:20
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 9, 2026 03:20

Dismissing prior approval to re-evaluate 272cf9c

@juliusmarminge
juliusmarminge enabled auto-merge (squash) August 9, 2026 17:30
@juliusmarminge
juliusmarminge merged commit 285cf59 into pingdotgg:main Aug 9, 2026
17 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 9, 2026
## What's Changed
* fix(web): preserve desktop route during Clerk auth by @wobsoriano in pingdotgg/t3code#5770
* fix(web): match create theme and import theme buttons to the standard outline style by @UtkarshUsername in pingdotgg/t3code#5860

## New Contributors
* @wobsoriano made their first contribution in pingdotgg/t3code#5770

**Full Changelog**: pingdotgg/t3code@v0.0.33-nightly.20260809.1043...v0.0.33-nightly.20260809.1045

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.33-nightly.20260809.1045
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