Skip to content

Commit 98fe792

Browse files
authored
fix(clerk-js,types): Remove null from SignIn/SignUp future class `.s… (#6746)
1 parent bb8bac1 commit 98fe792

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

.changeset/nice-moons-repeat.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/clerk-js/src/core/resources/SignIn.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ class SignInFuture implements SignInFutureResource {
608608
constructor(readonly resource: SignIn) {}
609609

610610
get status() {
611-
return this.resource.status;
611+
// @TODO hooks-revamp: Consolidate this fallback val with stateProxy
612+
return this.resource.status || 'needs_identifier';
612613
}
613614

614615
get availableStrategies() {

packages/clerk-js/src/core/resources/SignUp.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,8 @@ class SignUpFuture implements SignUpFutureResource {
551551
constructor(readonly resource: SignUp) {}
552552

553553
get status() {
554-
return this.resource.status;
554+
// @TODO hooks-revamp: Consolidate this fallback val with stateProxy
555+
return this.resource.status || 'missing_requirements';
555556
}
556557

557558
get unverifiedFields() {

packages/types/src/signInFuture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export interface SignInFutureResource {
132132
* The status of the current sign-in attempt as a string (for example, `'needs_identifier'`, `'needs_first_factor'`,
133133
* `'complete'`, etc.)
134134
*/
135-
readonly status: SignInStatus | null;
135+
readonly status: SignInStatus;
136136

137137
/**
138138
* Indicates that there is not a matching user for the first-factor verification used, and that the sign-in can be

packages/types/src/signUpFuture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export interface SignUpFutureResource {
6666
/**
6767
* The status of the current sign-up attempt as a string (for example, `'missing_requirements'`, `'complete'`, `'abandoned'`, etc.)
6868
*/
69-
readonly status: SignUpStatus | null;
69+
readonly status: SignUpStatus;
7070

7171
/**
7272
* An array of strings representing unverified fields such as `’email_address’`. Can be used to detect when verification is necessary.

0 commit comments

Comments
 (0)