Authenticate Your UsersEmail OTP
Authenticate User via Email OTP
Learn how to authenticate users via Email OTP with the Okto SDK.
Methods Overview
Methods | Description |
---|---|
async sendEmailOTP(email) | Send an OTP to the user's email |
async verifyEmailOTP(email, otp, token) | Verify the OTP sent to the user's email |
Send Email OTP
sendEmailOTP(email)
sends an OTP to the specified email address.
Parameters
Parameter | Type | Description |
---|---|---|
email | string | The user's email address |
Response
Success Response
Field Name | Type | Description |
---|---|---|
status | string | The status of the request |
token | string | A token to be used for OTP verification |
Verify Email OTP
verifyEmailOTP(email, otp, token)
verifies the OTP sent to the user's email address.
Parameters
Parameter | Type | Description |
---|---|---|
email | string | The user's email address |
otp | string | The OTP received by the user |
token | string | The token received from sendEmailOTP |
Response
Success Response
Field Name | Type | Description | Possible Values |
---|---|---|---|
result | boolean | Results true if OTP verification is successful | true , false |