Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/web/src/components/clerk/authRedirect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { resolveClerkSignInProps } from "./authRedirect";
describe("resolveClerkSignInProps", () => {
it("returns to the current browser URL on the web", () => {
const href = "https://app.t3.codes/connect?state=state-1#details";
expect(resolveClerkSignInProps(href, false)).toEqual({ forceRedirectUrl: href });
expect(resolveClerkSignInProps(href, false)).toEqual({
forceRedirectUrl: href,
signUpForceRedirectUrl: href,
});
});

it("removes a Clerk virtual pathname and callback params while preserving the desktop route", () => {
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/components/clerk/authRedirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ export function resolveClerkSignInProps(href: string, isElectron: boolean): Cler
signUpForceRedirectUrl: redirectUrl.toString(),
};
}
return { forceRedirectUrl: href };
// Sign-up completes on its own redirect, so it needs the same target as
// sign-in. Without it Clerk falls back to its dashboard default and lands on
// a route this app does not serve.
return { forceRedirectUrl: href, signUpForceRedirectUrl: href };
}
Loading