fix(web): preserve desktop route during Clerk auth - #5770
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: Needs human review This PR modifies authentication redirect logic in the Clerk auth integration ( You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate 3301d07
Dismissing prior approval to re-evaluate 272cf9c
## 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
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
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.
resolveClerkSignInPropsnow normalizes the currentwindow.location.hrefby clearing Clerk’s virtual pathname and query string while keeping the hash route (e.g.#/settings/connections), then setsforceRedirectUrlandsignUpForceRedirectUrlto that URL.Web behavior is unchanged: it still passes the full
hrefasforceRedirectUrlonly.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,
resolveClerkSignInPropspreviously returned an empty object, skipping redirect overrides. It now returnsforceRedirectUrlandsignUpForceRedirectUrlset 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.