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

#159054010 Password Reset Feature #14

Merged
merged 13 commits into from
Aug 3, 2018
Merged

Conversation

asamisellah
Copy link
Collaborator

@asamisellah asamisellah commented Aug 3, 2018

What does this PR do?

Implement reset password with email verification

Description of Task to be completed?

  • Sends verification email to the user for password reset
  • Verify the user and updates the new user password
Endpoints
METHOD ENDPOINT FUNCTIONALITY
POST /api/users/forgot_password Sends reset password verification email
PUT /api/users/resetpassword Validates email and resets user password

How should this be manually tested?

  • Clone this repo
  • Create an account with sendgrid and acquire an apikey which you will add to the .env as follows
    EMAIL_HOST_PASSWORD=YOUR_SENDGRID_API_KEY
cd ah-jarvis

git pull origin ft-reset-password-159054010
  
create and activate a virtual env 

pip install -r requirements.txt

python manage.py migrate

coverage run manage.py test

python manage.py run server

  • Launch Postman App.
  • Register an account with your valid email as follows:
URL: http://127.0.0.1:8000/api/users/

{
  "user": {
	"username":"jake",
	"email":"validemail@example.com",
	"password":"Pass1234"
  }
}

register

  • Post your valid email to get a Password Reset Validation email
URL: http://127.0.0.1:8000/api/users/forgot_password

{
  "email": "validemail@example.com"
}

post_email

  • Open your email and find an email from webmaster@localhost
  • Copy the last part of the URL(the token)
  • Include the token as an input in the reset password endpoint as follows:
URL: http://127.0.0.1:8000/api/users/resetpassword

{
  "reset_data":{
  	"token": "token_sent_to_email",
  	"email": "validemail@example.com",
  	"new_password": "new_password"
  }
}

reset

Any background context you want to provide?

None

What are the relevant pivotal tracker stories?

#159054010 Users should be able to reset password via email

@dwarukira
Copy link
Collaborator

Looks good. Need to resolve merge conflicts.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 96.569% when pulling f4211ef on ft-reset-password-159054010 into 7b27382 on develop.

@denniswanjiru
Copy link

Tried out the PR on my local machine and worked as expected. You need to resolve the conflicts, though.

@asamisellah
Copy link
Collaborator Author

@denniswanjiru Thanks for the feedback. I have resolved the merge conflicts

@jacksono jacksono merged commit 6dfd1e3 into develop Aug 3, 2018
@jacksono jacksono deleted the ft-reset-password-159054010 branch August 3, 2018 11:38
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.

None yet

5 participants