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

Feat/backend/reset password #148

Merged
merged 50 commits into from
Jul 8, 2024
Merged

Feat/backend/reset password #148

merged 50 commits into from
Jul 8, 2024

Conversation

u21631532
Copy link
Contributor

@u21631532 u21631532 commented Jul 4, 2024

Description

This PR implements a password reset functionality for the Occupi backend. It includes a new endpoint for initiating a password reset, a mechanism for validating reset tokens, and updates to the middleware to handle password reset requests securely.

Fixes #[Issue number related to password reset feature]

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

The following tests were conducted to verify the changes:

  • Unit tests for the ResetPassword function
  • Unit tests for the CompletePasswordReset function
  • Unit tests for the AddResetToken function
  • Unit tests for the GetEmailByResetToken function
  • Unit tests for the CheckResetToken function
  • Integration tests for the /auth/forgot-password endpoint
  • Manual testing using Postman for the https://dev.occupi.tech/auth/forgot-password endpoint
  • Manual testing using Postman for the https://dev.occupi.tech/auth/forgot-password-reset endpoint
  • Verified email delivery for password reset requests
  • Tested rate limiting on the password reset endpoint

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have refactored middleware to eliminate code duplication as identified by the linter

u21631532 added 30 commits July 3, 2024 13:29
@u21631532 u21631532 self-assigned this Jul 4, 2024
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.85%. Comparing base (e24e812) to head (d074cde).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #148   +/-   ##
========================================
  Coverage    85.85%   85.85%           
========================================
  Files            5        5           
  Lines          304      304           
========================================
  Hits           261      261           
  Misses          31       31           
  Partials        12       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

occupi-backend/configs/config.go Outdated Show resolved Hide resolved
occupi-backend/configs/config.go Show resolved Hide resolved
occupi-backend/pkg/router/router.go Outdated Show resolved Hide resolved
occupi-backend/pkg/router/router.go Outdated Show resolved Hide resolved
@waveyboym waveyboym linked an issue Jul 4, 2024 that may be closed by this pull request
3 tasks
@waveyboym waveyboym added status: pending This is awaiting approval and removed state: approved This is complete and can be merged/closed labels Jul 4, 2024
@COS301-SE-2024 COS301-SE-2024 deleted a comment from waveyboym Jul 6, 2024
waveyboym and others added 15 commits July 6, 2024 19:53
…te middleware and include OTP for password reset
@u21631532 u21631532 requested a review from waveyboym July 8, 2024 08:05
@u21631532 u21631532 merged commit a3fc24d into develop Jul 8, 2024
6 checks passed
@u21631532 u21631532 deleted the feat/backend/reset-password branch July 8, 2024 08:30
waveyboym pushed a commit that referenced this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: 3 This can be/was resolved in minutes be requires/required deep engagement For: api This is mainly for the api For: backend This is mainly for the backend code status: pending This is awaiting approval type: feature A new feature type: testing This affects one or more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Auth endpoint for resetting-password
2 participants