Open rehan-adi opened 2 weeks ago
Turbocell is using next-auth heavily, we don't need extra sign up next-auth takes care of it, sign-in creates an account if does not already exist in the database.
We need to implement a /profile page to handle email verification. Since next-auth manages sign-ups and sign-ins, our focus is on allowing users to verify their email addresses post-login with OAuth (Google/Discord).
On the /profile page, provide an option for users to request email verification. This will involve sending a verification email to the user. Once the user verifies their email, update the emailVerified field in the database (emailVerified DateTime?) to reflect this change. A null value indicates that the email has not been verified yet.
Ensure that after verification, the emailVerified field is populated with the current date and time to confirm successful verification.
https://github.com/me-imfhd/turbocell/blob/main/packages/db/prisma/schema.prisma#L65
You can query this to check user is verified or not.
Description: Currently, the project includes signin and logout functionality but lacks a signup feature. A signup page is essential for new users to create accounts. To enhance security, I propose implementing email verification during the signup process.
Frontend:
Backend:
Security: