E-Mail Verification
WARNING
User must be logged in to call this method
User with verified E-Mail can:
- Reset their password if they've forgotten it.
- Receive newsletter from the service owner if they choose to.
- Recover their disabled account.
- Allow their email address to be public to other users if they choose.
You can verify your user's email address with verifyEmail()
.
TIP
The user's email is automatically verified if signup confirmation was requested in signup()
.
The example below shows how you can verify your users email address.
- The first method call, without any arguments, sends a verification email to the user.
- The second call completes the verification process by passing the verification code that user retrieved from their email.
js
// Send verification code to user's E-Mail
skapi.verifyEmail().then(res=>{
// 'SUCCESS: Verification code has been sent.'
console.log(res);
// Prompt user to enter the verification code
let code = prompt('Enter the verification code sent to your E-Mail');
// Verify E-Mail with the code
skapi.verifyEmail({ code }).then(res=>{
// SUCCESS: "email" is verified.
window.alert('Your email is verified');
});
});
For more detailed information on all the parameters and options available with the verifyEmail()
method, please refer to the API Reference below:
verifyEmail(params?): Promise(string)
WARNING
The user's email verified state will be lost if the user had changed their email address.