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

Added Resend Email Verification and Delete Unverified Users after 24 Hours #436

Merged
merged 11 commits into from
Nov 9, 2024

Conversation

IkkiOcean
Copy link
Contributor

This PR introduces two major features:

  1. Resend Email Verification: Users who haven't verified their accounts can now request to resend the email verification link.
  2. Delete Unverified Users: A scheduled task that deletes users who have not verified their account within 24 hours of registration.

Key Changes:

Backend Changes:

  1. User Schema Update:

    • A new field timestamps has been added to the user schema to track the timestamp of when the account was added.
  2. New Routes:

    • A route has been added to allow users to request the resending of the email verification link.
  3. UserController Updates:

    • Logic has been implemented in the UserController to handle the resending of verification emails, ensuring that the email is only resent after a 24-hour period has passed.
    • A scheduled task using a cron job has been added to delete unverified users who have not verified their account within 24 hours.

Frontend Changes:

  1. Resend Email Verification Page:

    • A new page has been created on the frontend where users can request to resend the verification email if they have not received it or if the link has expired.
  2. Resend Button:

    • A UI button has been added to trigger the request for the verification email to be resent.

Summary of Changes:

  1. Backend:

    • Updated the user schema to track the email resend timestamp.
    • Created routes for resending email verification links.
    • Implemented functionality for deleting unverified users after 24 hours.
    • Cron job added to automatically delete unverified users at midnight every day.
  2. Frontend:

    • Added a page for users to request a new verification email.
    • Added functionality to handle user input and communicate with the backend to resend the email.

This PR aims to improve user experience by allowing users to request the resend of verification emails, and also ensures that unverified users are automatically cleaned up after 24 hours, enhancing overall system efficiency. Let me know if further changes or improvements are needed.

How should this be tested?

  1. try signup and do no verify with the first email, instead click on the resend verification email button for new link
  2. during the start of backend, the terminal will log the start of deletion job

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

VIDEO and Screenshot

  • reverify
rev.mp4
  • deletion of unverified user
Screenshot 2024-11-09 at 1 47 28 PM

Copy link

netlify bot commented Nov 9, 2024

Deploy Preview for delightful-daifuku-a9f6ea ready!

Name Link
🔨 Latest commit 82c755e
🔍 Latest deploy log https://app.netlify.com/sites/delightful-daifuku-a9f6ea/deploys/672f6779eb302a0008171514
😎 Deploy Preview https://deploy-preview-436--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

IkkiOcean commented Nov 9, 2024

@AlfiyaSiddique please merge #435 before this to prevent any merge conflicts and this adds feature on that branch.

note: I have used timer of 10 sec in video to show resend email verification functionality, but its 2 min in real to prevent email spam.

@AlfiyaSiddique
Copy link
Owner

@IkkiOcean please resolve conflicts

@IkkiOcean
Copy link
Contributor Author

@AlfiyaSiddique
done :)

@AlfiyaSiddique
Copy link
Owner

@IkkiOcean I have merged 435 before this still it has conflicts,
Can you please resolve

@IkkiOcean
Copy link
Contributor Author

@AlfiyaSiddique yes. I was actively removing them. it done now. you can merge

@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 9a01133 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! 🚀

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