You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @property {string} 'needs_identifier' - The user's identifier (e.g., email address, phone number, username) hasn't been provided.
62
+
* @property {string} 'needs_first_factor' - One of the following [first factor verification](!first-factor-verification) strategies is missing: `'email_link'`, `'email_code'`, `passkey`, `password`, `'phone_code'`, `'web3_base_signature'`, `'web3_metamask_signature'`, `'web3_coinbase_wallet_signature'`, `'web3_okx_wallet_signature'`, `'web3_solana_signature'`, [`OAuthStrategy`](https://clerk.com/docs/reference/types/sso#o-auth-strategy), or `'enterprise_sso'`.
63
+
* @property {string} 'needs_second_factor' - One of the following [second factor verification](!second-factor-verification) strategies is missing: `'phone_code'`, `'totp'`, `'backup_code'`, `'email_code'`, or `'email_link'`.
64
+
* @property {string} 'needs_client_trust' - The user is signing in from a new device and must complete a [second factor verification](!second-factor-verification) to establish [Client Trust](https://clerk.com/docs/guides/secure/client-trust). See the [Client Trust custom flow guide](https://clerk.com/docs/guides/development/custom-flows/authentication/client-trust) for more information.
65
+
* @property {string} 'needs_new_password' - The user needs to set a new password. See the [dedicated custom flow](https://clerk.com/docs/guides/development/custom-flows/account-updates/forgot-password) guide for more information.
Copy file name to clipboardExpand all lines: packages/shared/src/types/signInFuture.ts
+33-49Lines changed: 33 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -8,43 +8,35 @@ import type { Web3Provider } from './web3';
8
8
9
9
exportinterfaceSignInFutureCreateParams{
10
10
/**
11
-
* The authentication identifier for the sign-in. This can be the value of the user's email address, phone number,
12
-
* username, or Web3 wallet address.
11
+
* The authentication identifier for the sign-in. This can be the value of the user's email address, phone number, username, or Web3 wallet address.
13
12
*/
14
13
identifier?: string;
15
14
/**
16
-
* The user's password. Only supported if
17
-
* [password](https://clerk.com/docs/guides/configure/auth-strategies/sign-up-sign-in-options#password) is enabled.
15
+
* The user's password. Only supported if [password](https://clerk.com/docs/guides/configure/auth-strategies/sign-up-sign-in-options#password) is enabled.
18
16
*/
19
17
password?: string;
20
18
/**
21
-
* The first factor verification strategy to use in the sign-in flow. Depends on the `identifier` value. Each
22
-
* authentication identifier supports different verification strategies.
19
+
* The first factor verification strategy to use in the sign-in flow. Depends on the `identifier` value. Each authentication identifier supports different verification strategies.
* The full URL or path that the OAuth provider should redirect to after successful authorization on their part.
27
24
*/
28
25
redirectUrl?: string;
29
26
/**
30
-
* The URL that the user will be redirected to, after successful authorization from the OAuth provider and
31
-
* Clerk sign-in.
27
+
* The URL that the user will be redirected to, after successful authorization from the OAuth provider and Clerk sign-in.
32
28
*/
33
29
actionCompleteRedirectUrl?: string;
34
30
/**
35
-
* When set to `true`, the `SignIn` will attempt to retrieve information from the active `SignUp` instance and use it
36
-
* to complete the sign-in process. This is useful when you want to seamlessly transition a user from a sign-up
37
-
* attempt to a sign-in attempt.
31
+
* When set to `true`, the `SignIn` will attempt to retrieve information from the active `SignUp` instance and use it to complete the sign-in process. This is useful when you want to seamlessly transition a user from a sign-up attempt to a sign-in attempt.
38
32
*/
39
33
transfer?: boolean;
40
34
/**
41
-
* The [ticket _or token_](https://clerk.com/docs/guides/development/custom-flows/authentication/application-invitations)
42
-
* generated from the Backend API. **Required** if `strategy` is set to `'ticket'`.
35
+
* **Required** if `strategy` is set to `'ticket'`. The [ticket _or token_](https://clerk.com/docs/guides/development/custom-flows/authentication/application-invitations) generated from the Backend API.
43
36
*/
44
37
ticket?: string;
45
38
/**
46
-
* When set to `true`, if a user does not exist, the sign-up will prepare a transfer to sign up a new
47
-
* account. If bot sign-up protection is enabled, captcha will also be required on sign in.
39
+
* When set to `true`, if a user does not exist, the sign-up will prepare a transfer to sign up a new account. If bot sign-up protection is enabled, captcha will also be required on sign in.
48
40
*/
49
41
signUpIfMissing?: boolean;
50
42
}
@@ -90,6 +82,7 @@ export type SignInFuturePasswordParams = {
90
82
}
91
83
);
92
84
85
+
/** Parameters for sending a sign-in email verification code. */
93
86
exporttypeSignInFutureEmailCodeSendParams=
94
87
|{
95
88
/**
@@ -107,6 +100,7 @@ export type SignInFutureEmailCodeSendParams =
107
100
emailAddress?: never;
108
101
};
109
102
103
+
/** Parameters for sending a sign-in email link. */
110
104
exporttypeSignInFutureEmailLinkSendParams={
111
105
/**
112
106
* The full URL that the user will be redirected to when they visit the email link.
@@ -115,15 +109,14 @@ export type SignInFutureEmailLinkSendParams = {
115
109
}&(
116
110
|{
117
111
/**
118
-
* The user's email address. Only supported if [Email address](https://clerk.com/docs/guides/configure/auth-strategies/sign-up-sign-in-options#email)
119
-
* is enabled.
112
+
* The user's email address. Only supported if [Email address](https://clerk.com/docs/guides/configure/auth-strategies/sign-up-sign-in-options#email) is enabled. Provide either `emailAddress` or `emailAddressId`, not both. Omit both when a sign-in already exists and you are sending to the identified user.
120
113
*/
121
114
emailAddress?: string;
122
115
emailAddressId?: never;
123
116
}
124
117
|{
125
118
/**
126
-
* The ID for the user's email address that will receive an email with the email link.
119
+
* The ID for the user's email address that will receive an email with the email link. Provide either `emailAddress` or `emailAddressId`, not both.
* The `SignInFuture` class holds the state of the current sign-in and provides helper methods to navigate and complete
306
-
* the sign-in process. It is used to manage the sign-in lifecycle, including the first and second factor verification,
307
-
* and the creation of a new session.
298
+
* The `SignInFuture` class holds the state of the current sign-in and provides helper methods to navigate and complete the sign-in process. It is used to manage the sign-in lifecycle, including the first and second factor verification, and the creation of a new session.
* Array of the first factors that are supported in the current sign-in. Each factor contains information about the
317
-
* verification strategy that can be used.
307
+
* Array of the first factors that are supported in the current sign-in. Each factor contains information about the verification strategy that can be used.
* Array of the second factors that are supported in the current sign-in. Each factor contains information about the
323
-
* verification strategy that can be used. This property is populated only when the first factor is verified.
312
+
* Array of the second factors that are supported in the current sign-in. Each factor contains information about the verification strategy that can be used. This property is populated only when the first factor is verified.
* Indicates that there is not a matching user for the first-factor verification used, and that the sign-in can be
334
-
* transferred to a sign-up.
322
+
* Indicates that there is not a matching user for the first-factor verification used, and that the sign-in can be transferred to a sign-up.
335
323
*/
336
324
readonlyisTransferable: boolean;
337
325
326
+
/**
327
+
* Reflects that the sign-in was not able to create a new session because the identifier already exists in an existing session.
328
+
* @property {string} sessionId - The ID of the existing session.
329
+
*/
338
330
readonlyexistingSession?: {sessionId: string};
339
331
340
332
/**
341
-
* The state of the verification process for the selected first factor. Initially, this property contains an empty
342
-
* verification object, since there is no first factor selected.
333
+
* The state of the verification process for the selected first factor. Initially, this property contains an empty verification object, since there is no first factor selected.
* The state of the verification process for the selected second factor. Initially, this property contains an empty
348
-
* verification object, since there is no second factor selected.
338
+
* The state of the verification process for the selected second factor. Initially, this property contains an empty verification object, since there is no second factor selected.
* The authentication identifier value for the current sign-in. `null` if the `strategy` is `'oauth_<provider>'`
354
-
* or `'enterprise_sso'`.
343
+
* The authentication identifier value for the current sign-in. `null` if the `strategy` is `'oauth_<provider>'` or `'enterprise_sso'`.
355
344
*/
356
345
readonlyidentifier: string|null;
357
346
358
347
/**
359
-
* The identifier of the session that was created upon completion of the current sign-in. The value of this property
360
-
* is `null` if the sign-in status is not `'complete'`.
348
+
* The ID of the session that was created upon completion of the current sign-in. The value of this property is `null` if the sign-in status is not `'complete'`.
361
349
*/
362
350
readonlycreatedSessionId: string|null;
363
351
364
352
/**
365
-
* An object containing information about the user of the current sign-in. This property is populated only once an
366
-
* identifier is given to the `SignIn` object through `signIn.create()` or another method that populates the
367
-
* `identifier` property.
353
+
* An object containing information about the user of the current sign-in. This property is populated only once an identifier is given to the `SignIn` object through `signIn.create()` or another method that populates the `identifier` property.
* Creates a new `SignIn` instance initialized with the provided parameters. The instance maintains the sign-in
380
-
* lifecycle state through its `status` property, which updates as the authentication flow progresses.
365
+
* Creates a new `SignIn` instance initialized with the provided parameters. The instance maintains the sign-in lifecycle state through its `status` property, which updates as the authentication flow progresses. Once the sign-in process is complete, call the `signIn.finalize()` method to set the newly created session as the active session.
381
366
*
382
-
* What you must pass to `params` depends on which [sign-in options](https://clerk.com/docs/guides/configure/auth-strategies/sign-up-sign-in-options)
383
-
* you have enabled in your app's settings in the Clerk Dashboard.
367
+
* What you must pass to `params` depends on which [sign-in options](https://clerk.com/docs/guides/configure/auth-strategies/sign-up-sign-in-options) you have enabled in your app's settings in the Clerk Dashboard.
384
368
*
385
-
* You can complete the sign-in process in one step if you supply the required fields to `create()`. Otherwise,
386
-
* Clerk's sign-in process provides great flexibility and allows users to easily create multi-step sign-in flows.
369
+
* You can complete the sign-in process in one step if you supply the required fields to `create()`. Otherwise, Clerk's sign-in process provides great flexibility and allows users to easily create multi-step sign-in flows.
387
370
*
388
-
* > [!WARNING]
389
-
* > Once the sign-in process is complete, call the `signIn.finalize()` method to set the newly created session as
390
-
* > the active session.
371
+
* > [!IMPORTANT]
372
+
* > The `signIn.create()` method is intended for advanced use cases. For most use cases, prefer the use of the factor-specific methods such as `signIn.password()`, `signIn.emailCode.sendCode()`, etc.
* The verification status of the email link. This property is populated by reading query parameters from the URL after the user visits the email link. Returns `null` if no verification status is available.
0 commit comments