Skip to content

Commit

Permalink
fix(clerk-js): Navigate back to the continue step when editing the id…
Browse files Browse the repository at this point in the history
…entifier (#1870)
  • Loading branch information
desiprisg authored Oct 16, 2023
1 parent a46d6fe commit 81b63e3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-points-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': minor
---

Add new `/sign-up/continue/verify-phone-number` and `/sign-up/continue/verify-email-address` routes in order to allow navigating back to the `/sign-up/continue` step when editing the extra identifier that is provided in the `/sign-up/continue` step.
16 changes: 15 additions & 1 deletion packages/clerk-js/src/ui/components/SignUp/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,21 @@ function SignUpRoutes(): JSX.Element {
/>
</Route>
<Route path='continue'>
<SignUpContinue />
<Route
path='verify-email-address'
canActivate={clerk => !!clerk.client.signUp.emailAddress}
>
<SignUpVerifyEmail />
</Route>
<Route
path='verify-phone-number'
canActivate={clerk => !!clerk.client.signUp.phoneNumber}
>
<SignUpVerifyPhone />
</Route>
<Route index>
<SignUpContinue />
</Route>
</Route>
<Route index>
<SignUpStart />
Expand Down
4 changes: 2 additions & 2 deletions packages/clerk-js/src/ui/components/SignUp/SignUpContinue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ function _SignUpContinue() {
.then(res =>
completeSignUpFlow({
signUp: res,
verifyEmailPath: '../verify-email-address',
verifyPhonePath: '../verify-phone-number',
verifyEmailPath: './verify-email-address',
verifyPhonePath: './verify-phone-number',
handleComplete: () => clerk.setActive({ session: res.createdSessionId, beforeEmit: navigateAfterSignUp }),
navigate,
}),
Expand Down

0 comments on commit 81b63e3

Please sign in to comment.