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

Implement Email Verification during User Registration #23

Closed
StefanPenchev05 opened this issue Mar 6, 2024 · 3 comments · Fixed by #28
Closed

Implement Email Verification during User Registration #23

StefanPenchev05 opened this issue Mar 6, 2024 · 3 comments · Fixed by #28
Assignees
Labels
backend Changes that affect the backend critical Must be addressed as soon as possible, affecting live functionality development Still in the development phase enhancement New feature or request

Comments

@StefanPenchev05
Copy link
Owner

StefanPenchev05 commented Mar 6, 2024

As part of our user registration process, we need to implement an email verification step to ensure that users provide a valid email address and that they have access to it.

Tasks:

  1. Generate a unique token for each new user during registration.
  2. Temporarily store the user's data and the token in a cache or a temporary collection in the database.
  3. Send an email to the user with a verification link. The link should include the token as a query parameter.
  4. When the user clicks the verification link, validate the token, move the user's data from the temporary storage to the actual user collection, and mark the user's email as verified.
  5. If the user does not click the verification link within 15 minutes, the token should expire and the user's data should be removed from the temporary storage.

Acceptance Criteria:

A user should not be able to complete registration without verifying their email.
A user should receive a clear message if their verification link is invalid or expired.
The system should handle the scenario where the email sending fails.

Estimated Time:

5 days

Dependencies:

Nodemailer for sending emails, Mongo for temporary storage(Implement logic like in Redis) and using uuid for unique number stored in TempMemory in Mongo

@StefanPenchev05 StefanPenchev05 added enhancement New feature or request development Still in the development phase backend Changes that affect the backend critical Must be addressed as soon as possible, affecting live functionality labels Mar 6, 2024
@StefanPenchev05 StefanPenchev05 added this to the Register Controller milestone Mar 6, 2024
@StefanPenchev05 StefanPenchev05 self-assigned this Mar 6, 2024
@StefanPenchev05 StefanPenchev05 pinned this issue Mar 6, 2024
@StefanPenchev05
Copy link
Owner Author

They may be a room for improvements in emailServices.js. For now I will leave it as it is, in the future can be made a better html for the client and enhancement for error handling

StefanPenchev05 added a commit that referenced this issue Mar 6, 2024
StefanPenchev05 added a commit that referenced this issue Mar 6, 2024
…verification. Modifed emmailService.js for seding emails (#23)
@StefanPenchev05
Copy link
Owner Author

Tomorrow will make:

  1. Validations if the user try to make another request for verification before the time expires.
  2. Verify end point - save user information and redirect him to user settings where he can add other data

@StefanPenchev05
Copy link
Owner Author

Things to do tomorrow

  1. Middleware to check if the ip has already been made the request for verification before his 15 minutes are up(security)
  2. Feature for suggesting a name, it will not suggest names in the tempData, it is possible bug
  3. Finally, web socket when the user verified himself to redirect him to the window which is waiting for validation and return verified

@StefanPenchev05 StefanPenchev05 moved this from Done to In Progress in @StefanPenchev05's MyClothesV2 project Mar 8, 2024
StefanPenchev05 added a commit that referenced this issue Mar 11, 2024
… when it is verified the server to send to him message with verified #23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Changes that affect the backend critical Must be addressed as soon as possible, affecting live functionality development Still in the development phase enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant