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 User Verification Route and Email Notification #59

Merged
merged 2 commits into from
May 5, 2024

Conversation

maxCastro1
Copy link
Contributor

This PR introduces several enhancements to the user registration and verification process.

User Verification Route:

  • A new route POST /user/verify/:id has been added for user verification. This route handles the verification of a user when they click on the verification link in the email.
  • The userVerificationService function has been created to handle the logic for this route. It checks if the user ID is provided, finds the user in the database using the user ID, sets the verified field of the user to true, and then saves the user back to the database.

Email Verification Link:

  • When a new user is registered, a verification email is sent to them with a link to the user verification route. The link includes the user’s ID as a parameter.
  • The sendMail function has been updated to include the verification link in the email.

Tests:

  • Tests have been added for the userVerificationService function. The tests first create a new user, then call the userVerificationService function to verify the user, and finally assert that the user’s verified field has been set to true.

@faid-terence
Copy link
Collaborator

@maxCastro1 Please keep one test coverage badge , also remove the console logs
Screenshot from 2024-05-04 19-41-55
Screenshot from 2024-05-04 19-39-44

@faid-terence faid-terence added this to the Authentication and RBAC milestone May 4, 2024
@faid-terence faid-terence added the In Progress This Label will be added on pending task label May 4, 2024
@maxCastro1 maxCastro1 force-pushed the fix-feature-user-registration branch 3 times, most recently from 95e22da to 8e48e13 Compare May 5, 2024 10:42
@coveralls
Copy link

coveralls commented May 5, 2024

Pull Request Test Coverage Report for Build 8959769053

Details

  • 65 of 74 (87.84%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.7%) to 72.768%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/utils/sendMail.ts 10 11 90.91%
src/services/userServices/userValidationService.ts 11 13 84.62%
src/services/userServices/userRegistrationService.ts 32 38 84.21%
Totals Coverage Status
Change from base Build 8944097307: 1.7%
Covered Lines: 144
Relevant Lines: 178

💛 - Coveralls

@maxCastro1 maxCastro1 force-pushed the fix-feature-user-registration branch 2 times, most recently from 58034f2 to 028245e Compare May 5, 2024 11:50
@faid-terence faid-terence force-pushed the fix-feature-user-registration branch from 028245e to 180a056 Compare May 5, 2024 12:10
@faid-terence faid-terence added the Highest priority Has more priority label May 5, 2024
@maxCastro1 maxCastro1 force-pushed the fix-feature-user-registration branch 3 times, most recently from 87ccd0c to 2abbc37 Compare May 5, 2024 13:15
… hashing, and database integration

fix(user registration): resolve registration bug

- ensure that a user provide neccessary inputs
- restructure user entity
- refactor other codes depending on user registration logic

[Fixes #39]

rebasing from develop , adding verifie route and service and send email to the user

rebasing from develop , adding verifie route and service and send email to the user
@maxCastro1 maxCastro1 force-pushed the fix-feature-user-registration branch from 2abbc37 to 2b118c3 Compare May 5, 2024 13:18
@faid-terence
Copy link
Collaborator

@maxCastro1
Resolve the conflicts

@faid-terence faid-terence added Ready for reviews Pull request is ready for review and removed In Progress This Label will be added on pending task labels May 5, 2024
Copy link
Collaborator

@faid-terence faid-terence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Work @maxCastro1

@faid-terence faid-terence merged commit a860281 into develop May 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Highest priority Has more priority Ready for reviews Pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants