Authenticate Your UsersEmail OTP

Authenticate User via Email OTP

Learn how to authenticate users via Email OTP with the Okto SDK.

Methods Overview

MethodsDescription
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 user's email address.

Parameters

ParameterTypeDescription
emailstringThe user's email address

Response

Success Response

Field NameTypeDescription
statusstringThe status of the request
tokenstringA 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

ParameterTypeDescription
emailstringThe user's email address
otpstringThe OTP received by the user
tokenstringThe token received from sendEmailOTP

Response

Success Response

Field NameTypeDescriptionPossible Values
resultbooleanResults true if OTP verification is successfultrue, false

On this page