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.
function verifyEmail(code: string): Promise<void>;
OTP code the member received in an email.
import { authentication } from "wix-members-frontend";
authentication
.verifyEmail(code)
.then(() => {
console.log("OTP verified");
})
.catch((error) => {
console.error("Error verifying OTP:", error);
});
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.