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 Email Verification During Sign-Up #435

Merged
merged 8 commits into from
Nov 9, 2024

Conversation

IkkiOcean
Copy link
Contributor

@IkkiOcean IkkiOcean commented Nov 8, 2024

Description:

This PR introduces the functionality to verify the user's email during the sign-up process. After a successful sign-up, the user is prompted to verify their email by clicking a link sent to their email address. The link is valid for 24 hours, after which it expires. Additionally, the login backend has been updated to allow only verified users to log in.

Changes Made:

  1. Email Verification After Sign-Up:

    • Flow: After the user successfully signs up, an email is sent containing a verification link.
    • Verification Link: The link expires after 24 hours, requiring the user to verify their email within that time frame.
    • Email Content: The email includes a unique token that the user can use to verify their email address.
  2. Login Backend Updates:

    • Updated the login endpoint to check if the user has a verified email before allowing login.
    • If the user's email is not verified, the login attempt will be rejected with a relevant message ("Please verify your email to log in").
    • Introduced a new emailVerified field in the user model to track email verification status.
  3. Frontend Changes:

    • Added a prompt for users to verify their email after they sign up, with a link to resend the verification email if necessary.
    • If the user tries to log in before verifying their email, an error message will be displayed indicating that the email needs to be verified first.

Screenshots/GIFs: (Optional)

verif.mp4

How should this be tested?

  • Go to Sign Up Page and register as new user. it will guide you through

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing guide
  • Self-reviewed my own code
  • Checked for warnings, there are none
  • Removed all console.logs
  • The changes don't cause any responsiveness issues

Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for delightful-daifuku-a9f6ea ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/delightful-daifuku-a9f6ea/deploys/672f662560aa1a3fb3f456db
😎 Deploy Preview https://deploy-preview-435--delightful-daifuku-a9f6ea.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@IkkiOcean
Copy link
Contributor Author

@AlfiyaSiddique as you can see this PR is already big so I will be implementing two features i.e

  1. Deletion of unverified accound after 24 hours
  2. Resend verification Email Feature
    in another PR. I hope you dont mind.

@IkkiOcean IkkiOcean changed the title Add Email Verification During Sign-U Add Email Verification During Sign-Up Nov 8, 2024
@AlfiyaSiddique
Copy link
Owner

@IkkiOcean update this PR

@AlfiyaSiddique
Copy link
Owner

And in the video there are multiple success alert, is that fixed?

@IkkiOcean
Copy link
Contributor Author

And in the video there are multiple success alert, is that fixed?

yeah that's removed. I think I uploaded the earlier video

@AlfiyaSiddique AlfiyaSiddique added gssoc-ext For GSSOC Extended Contribution. level 3 GSSOC level 3 Contribution - 50 points hacktoberfest-accepted labels Nov 9, 2024
@AlfiyaSiddique AlfiyaSiddique merged commit 95e5942 into AlfiyaSiddique:master Nov 9, 2024
5 checks passed
Copy link

github-actions bot commented Nov 9, 2024

🎉 Thank you @IkkiOcean Your pull request has been successfully merged! 🎉 Thank you for your contribution to our project. Your efforts are greatly appreciated. Keep up the fantastic work! 🚀

@AlfiyaSiddique
Copy link
Owner

@IkkiOcean GETTING THIS ERROR IN LOG AND NOT ABLE TO SIGNUP:
image
Any idea what's the issue, I checked the env variables they look good
Any configuration that is needed from my side?

@IkkiOcean
Copy link
Contributor Author

@AlfiyaSiddique yes! your email credentials are wrong. I think it's the password. normal email password doesnt work here, you have to create a app password from your google account

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc-ext For GSSOC Extended Contribution. hacktoberfest-accepted level 3 GSSOC level 3 Contribution - 50 points
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FEATURE: Revamp Sign-Up Page with Verification Functionality
2 participants