Verification
These are all methods on the SignUp
class that allow you to verify a user's sign-up request.
prepareVerification()
The prepareVerification
is used to initiate the verification process for a field that requires it. As mentioned above, there are two fields that need to be verified:
emailAddress
: The email address can be verified via an email code. This is a one-time code that is sent to the email already provided to the SignUp object. TheprepareVerification
sends this email.phoneNumber
: The phone number can be verified via a phone code. This is a one-time code that is sent via an SMS to the phone already provided to the SignUp object. TheprepareVerification
sends this SMS.
- Name
strategy
- Type
'phone_code' | 'email_code' | 'email_link' | 'oauth_<provider>' | 'saml' | 'enterprise_sso' | 'web3_metamask_signature' | 'web3_coinbase_wallet_signature' | 'web3_okx_wallet_signature'
- Description
The verification strategy to validate the user's sign-up request. The following strategies are supported:
'phone_code'
: User will receive a one-time authentication code via SMS.'email_code'
: Send an email with a unique token to input.'email_link'
: Send an email with a link which validates sign-up.'oauth_<provider>'
: The user will be authenticated with their social connection account. See a list of supported values for<provider>
.'saml'
(deprecated): Deprecated in favor of'enterprise_sso'
. The user will be authenticated with their SAML account.'enterprise_sso'
: The user will be authenticated either through SAML or OIDC depending on the configuration of their enterprise SSO account.'web3_metamask_signature'
: The verification will attempt to be completed using the user's Web3 wallet address via Metamask. Theweb3_wallet_id
parameter can also be specified to select which of the user's known Web3 wallets will be used.'web3_coinbase_wallet_signature'
: The verification will attempt to be completed using the user's Web3 wallet address via Coinbase Wallet. Theweb3_wallet_id
parameter can also be specified to select which of the user's known Web3 wallets will be used.'web3_okx_wallet_signature'
: The verification will attempt to be completed using the user's Web3 wallet address via OKX Wallet. Theweb3_wallet_id
parameter can also be specified to select which of the user's known Web3 wallets will be used.
- Name
redirectUrl
- Type
string
- Description
If
strategy
is set to'oauth_<provider>'
or'enterprise_sso'
, this specifies the full URL or path that the OAuth provider should redirect to after successful authorization. Typically, this will be a simple/sso-callback
route that either callsClerk.handleRedirectCallback
or mounts the<AuthenticateWithRedirectCallback />
component. See the custom flow for implementation details.If
strategy
is set to'email_link'
, this specifies The full URL that the user will be redirected to when they visit the email link. See the custom flow for implementation details.
- Name
actionCompleteRedirectUrl?
- Type
string
- Description
The full URL or path that the user will be redirected to after successful authorization from the OAuth provider and Clerk sign-in.
- Name
oidcPrompt?
- Type
string
- Description
Optional if
strategy
is set to'oauth_<provider>'
or'enterprise_sso'
. The value to pass to the OIDCprompt
parameter in the generated OAuth redirect URL.
- Name
oidcLoginHint?
- Type
string
- Description
Optional if
strategy
is set to'oauth_<provider>'
or'enterprise_sso'
. The value to pass to the OIDClogin_hint
parameter in the generated OAuth redirect URL.
attemptVerification()
Attempts to complete the in-flight verification process that corresponds to the given strategy. In order to use this method, you should first initiate a verification process by calling SignUp.prepareVerification.
Depending on the strategy, the method parameters could differ.
- Name
strategy
- Type
'phone_code' | 'email_code' | 'web3_metamask_signature' | 'web3_coinbase_wallet_signature' | 'web3_okx_wallet_signature'
- Description
The verification strategy to complete the user's sign-up request against. The following strategies are supported:
'phone_code'
: Validates an SMS with a unique token to input.'email_code'
: Validates an email with a unique token to input.'web3_metamask_signature'
: The verification will attempt to be completed using the user's Web3 wallet address via Metamask. Theweb3_wallet_id
parameter can also be specified to select which of the user's known Web3 wallets will be used.'web3_coinbase_wallet_signature'
: The verification will attempt to be completed using the user's Web3 wallet address via Coinbase Wallet. Theweb3_wallet_id
parameter can also be specified to select which of the user's known Web3 wallets will be used.'web3_okx_wallet_signature'
: The verification will attempt to be completed using the user's Web3 wallet address via OKX Wallet. Theweb3_wallet_id
parameter can also be specified to select which of the user's known Web3 wallets will be used.
- Name
code
- Type
string
- Description
The code that was sent to the user via the
'phone_code'
or'email_code'
verification strategies.
- Name
signature
- Type
string
- Description
The signature that was sent to the user via the Web3 verification strategy.
Feedback
Last updated on