Skip to content

feat: password reset email #471

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

Closed
wants to merge 26 commits into from

Conversation

Skibo555
Copy link

The endpoint allows users to reset their password by providing the password they used in registration.

Description

The endpoint takes the email the user provided and compare it again the record in the database if it matches any email, if it does, it sends a password reset link into the user's email and returns 200 OK status code. If the email does not exist in the database, it returns "We don't have user with the provided email in our database." and 404 status code.

Related Issue (Link to issue ticket)

#51

Motivation and Context

This will allow users to retrieve their email should in case anything happen to their account provided thy know the email address.

How Has This Been Tested?

Yes, I tested it using pytest and Postman.

Screenshots (if appropriate - Postman, etc):


Screenshot 2024-07-24 at 15 10 24
Screenshot 2024-07-24 at 15 15 21
Screenshot 2024-07-24 at 15 15 58
Screenshot 2024-07-24 at 15 53 11
Screenshot 2024-07-24 at 19 20 26

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Skibo555 added 26 commits July 25, 2024 17:04
…d-email

I added the endpoint for users to request for password reset and a link will be sent to the user if the user provides an email that is in the database
…d-email

I just made some changes to my pytest
…d-email

I just finished fixing my pytest, I pray it works.
@Skibo555
Copy link
Author

I've been deactivated from the slack channel though!


# Protected route example: test route
@auth.get("/admin")
def read_admin_data(current_admin: Annotated[User, Depends(user_service.get_current_super_admin)]):
return {"message": "Hello, admin!"}

def generate_access_token(data: dict, expires_delta: Optional[timedelta] = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

From here, all of this needs to be in user service.
Generate access token has been taken care of

Copy link
Author

Choose a reason for hiding this comment

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

Once it's put there, it does not work again for some reasons I can't explain, so I had to leave the functions in the auth file.

Copy link
Contributor

@joboy-dev joboy-dev left a comment

Choose a reason for hiding this comment

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

Remove this .idea from here
Don't check it ingo github

@joboy-dev
Copy link
Contributor

Closing this PR because this endpoint has been implemented and merged

@joboy-dev joboy-dev closed this Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants