Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Profile Page and Email Verification #3

Open
rehan-adi opened this issue Aug 28, 2024 · 1 comment
Open

Add Profile Page and Email Verification #3

rehan-adi opened this issue Aug 28, 2024 · 1 comment
Assignees

Comments

@rehan-adi
Copy link

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.

  1. Frontend:

    • Develop a signup form with fields for email, username, and password.
    • Integrate form validation using React and Zod.
  2. Backend:

    • Create a signup route that handles new user registration.
    • Use bcrypt for password hashing and Prisma for database interaction.
    • Implement email verification using Resend, sending a verification email upon signup.
    • Store a verification code in the database with an expiration timestamp.
    • Add validation for user input to prevent invalid data submission.
  3. Security:

    • Integrate JWT for generating secure tokens.
    • Implement checks to ensure the user verifies their email before gaining full access to the application.
@me-imfhd
Copy link
Owner

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.

@me-imfhd me-imfhd changed the title Add Signup Feature with Email Verification Add Profile Page and Email Verification Aug 30, 2024
@me-imfhd me-imfhd assigned me-imfhd and rehan-adi and unassigned me-imfhd Aug 30, 2024
@me-imfhd me-imfhd closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
@me-imfhd me-imfhd reopened this Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants