SuperTokens User is unable to access certain features due to unverified email.

The user's email address has not been verified.

Understanding SuperTokens: A Brief Overview

SuperTokens is an open-source authentication solution designed to simplify the process of adding secure authentication to your applications. It offers features like session management, social login, and email verification, making it a comprehensive tool for developers looking to implement authentication quickly and securely.

Identifying the Symptom: EMAIL_NOT_VERIFIED

When using SuperTokens, you might encounter the EMAIL_NOT_VERIFIED error. This typically manifests as users being unable to access certain features or functionalities within your application that require a verified email address.

Exploring the Issue: What Does EMAIL_NOT_VERIFIED Mean?

The EMAIL_NOT_VERIFIED error indicates that the user's email address has not been verified. This is a common requirement in applications to ensure that the email provided by the user is valid and accessible by them. Without verification, users may be restricted from accessing certain parts of the application.

Why Email Verification is Important

Email verification helps in maintaining the integrity of user data and prevents unauthorized access. It ensures that the email address provided is legitimate and owned by the user.

Steps to Resolve EMAIL_NOT_VERIFIED

To resolve the EMAIL_NOT_VERIFIED issue, follow these steps:

Step 1: Trigger a Verification Email

Ensure that your application is configured to send a verification email upon user registration. You can use SuperTokens' built-in email delivery service or integrate with third-party services like SendGrid or Mailgun.

const { sendEmailVerification } = require('supertokens-node/recipe/emailverification');

async function sendVerificationEmail(userId) {
await sendEmailVerification(userId);
}

Step 2: Prompt User to Verify Email

Once the verification email is sent, prompt the user to check their inbox and follow the verification link. This can be done through a notification or a message on your application's user interface.

Step 3: Handle Verification Link

Ensure that your application correctly handles the verification link. When the user clicks the link, it should redirect them to a page in your application that confirms their email has been verified.

const { verifyEmail } = require('supertokens-node/recipe/emailverification');

async function verifyUserEmail(token) {
const result = await verifyEmail(token);
if (result.status === 'OK') {
// Email verified successfully
} else {
// Handle error
}
}

Conclusion

By following these steps, you can effectively resolve the EMAIL_NOT_VERIFIED issue in your application. Ensuring that users verify their email addresses not only enhances security but also improves user trust in your application. For more detailed information, refer to the SuperTokens Documentation.

Try DrDroid: AI Agent for Debugging

80+ monitoring tool integrations
Long term memory about your stack
Locally run Mac App available

Thank you for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.
Read more
Time to stop copy pasting your errors onto Google!

Try DrDroid: AI for Debugging

80+ monitoring tool integrations
Long term memory about your stack
Locally run Mac App available

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

Thank you for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.
Read more
Time to stop copy pasting your errors onto Google!

MORE ISSUES

Deep Sea Tech Inc. — Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid