Skip to content

Commit 9655d93

Browse files
committed
fix(shared): return start only for a sign-up that has not been created
1 parent aceffa6 commit 9655d93

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/shared/src/internal/clerk-js/__tests__/nextStep.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ describe('getSignInNextStep', () => {
112112

113113
describe('getSignUpNextStep', () => {
114114
it('returns start before the sign-up is created', () => {
115-
expect(getSignUpNextStep(signUp({ status: null }))).toEqual({ type: 'start' });
115+
expect(getSignUpNextStep(signUp({ id: undefined, status: null }))).toEqual({ type: 'start' });
116+
});
117+
118+
it('returns unknown for a created sign-up with no status', () => {
119+
expect(getSignUpNextStep(signUp({ status: null }))).toEqual({ type: 'unknown' });
116120
});
117121

118122
it('returns start for a sign-up future that has not been created', () => {

‎packages/shared/src/internal/clerk-js/nextStep.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function getSignInNextStep(signIn: SignInNextStepInput): NextStep {
8282
* @internal
8383
*/
8484
export function getSignUpNextStep(signUp: SignUpNextStepInput): NextStep {
85-
if (!signUp.id || signUp.status === null) {
85+
if (!signUp.id) {
8686
return { type: 'start' };
8787
}
8888
if (signUp.status === 'complete') {

0 commit comments

Comments
 (0)