verifyEmail( )


Validates the email address using OTP (One-Time Password) that was sent during the registration.

Important:

This function is in Developer Preview and is subject to change.

The verifyEmail() function returns a Promise that resolves with true if the OTP is valid, or false if the validation fails.

Method Declaration
Copy
function verifyEmail(code: string): Promise<void>;
Method Parameters
codestringRequired

OTP code the member received in an email.

Verify the member's email address with a one-time password
JavaScript
import { authentication } from "wix-members-frontend"; authentication .verifyEmail(code) .then(() => { console.log("OTP verified"); }) .catch((error) => { console.error("Error verifying OTP:", error); });
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?