Allow for headless email or sms OTP authentication
useConnectWithOtp
hook exposes the connectWithEmail
, connectWithSms
and verifyOneTimePassword
functions, with these functions you can send an OTP to a user and then verify the OTP code the user received.
The hook works with Dynamic User Verification provider.
Method | Type | Description |
---|---|---|
connectWithEmail | (email: string) => Promise | Sends the OTP to the provided email |
connectWithSms | (phone: PhoneData) => Promise | Sends the OTP to the provided phone |
verifyOneTimePassword | (oneTimePassword: string) => Promise | Verify the provided OTP. The returned promise will be resolved if the OTP is valid or it will be rejected if the OTP is invalid |