diff --git a/.changeset/clean-rivers-sleep.md b/.changeset/clean-rivers-sleep.md new file mode 100644 index 0000000000..6cf7461efb --- /dev/null +++ b/.changeset/clean-rivers-sleep.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Fixes an issue during sign-up flow where a user lands on the continue step, and proceeds successfully through the sign-up process and gets redirected to AP sign-up due to signUp.id being undefined. diff --git a/packages/clerk-js/src/ui/components/SignUp/SignUpContinue.tsx b/packages/clerk-js/src/ui/components/SignUp/SignUpContinue.tsx index c08478e299..37444a1ed8 100644 --- a/packages/clerk-js/src/ui/components/SignUp/SignUpContinue.tsx +++ b/packages/clerk-js/src/ui/components/SignUp/SignUpContinue.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import React, { useMemo } from 'react'; +import React, { useEffect, useMemo } from 'react'; import { useCoreSignUp, useEnvironment, useSignUpContext } from '../../contexts'; import { descriptors, Flex, Flow, localizationKeys } from '../../customizables'; @@ -84,9 +84,15 @@ function _SignUpContinue() { [signUp.missingFields], ); - // Redirect to sign-up if there is no persisted sign-up + useEffect(() => { + // Redirect to sign-up if there is no persisted sign-up + if (!signUp.id) { + void navigate(displayConfig.signUpUrl); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + if (!signUp.id) { - void navigate(displayConfig.signUpUrl); return ; }