Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcarpenter committed Nov 21, 2024
1 parent f0a5237 commit 368eba5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 9 additions & 5 deletions packages/clerk-js/src/core/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1972,14 +1972,18 @@ export class Clerk implements ClerkInterface {
return '';
}

if (this.isCombinedFlow() && key === 'signUpUrl') {
return this.buildUrlWithAuth(`${this.#options.signInUrl}/create}`);
}

const signInOrUpUrl = this.#options[key] || this.environment.displayConfig[key];
const combinedFlowSignUpUrl = `${this.#options.signInUrl}#/create`;
const baseUrl = this.isCombinedFlow() && key === 'signUpUrl' ? combinedFlowSignUpUrl : signInOrUpUrl;
const redirectUrls = new RedirectUrls(this.#options, options).toSearchParams();
const initValues = new URLSearchParams(_initValues || {});
const url = buildURL({ base: signInOrUpUrl, hashSearchParams: [initValues, redirectUrls] }, { stringify: true });
const url = buildURL(
{
base: baseUrl,
hashSearchParams: [initValues, redirectUrls],
},
{ stringify: true },
);
return this.buildUrlWithAuth(url);
};

Expand Down
3 changes: 2 additions & 1 deletion packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ export function _SignInStart(): JSX.Element {
if (isCombinedFlow) {
const attribute = getSignUpAttributeFromIdentifier(identifierField);
clerk.client.signUp[attribute] = identifierField.value;
return navigate('create');
const createUrl = clerk.buildSignUpUrl();
return navigate(createUrl);
}
handleError(e, [identifierField, instantPasswordField], card.setError);
}
Expand Down

0 comments on commit 368eba5

Please sign in to comment.