Upd: Email service for forgot password added #15
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed: #14
Link to the org repo issue: dsc-x/omg-frames#2
Description
Just a rough idea of the system
![image](https://user-images.githubusercontent.com/51032928/103233201-801dee80-4962-11eb-94e5-ce7e958aaac3.png)
I will go through the stages:
User Clicks on Forgot Password
The user will be redirected to a form where they will be asked to enter the email address with which they registered. After submitting the form, a
POST
request will be sent to the endpoint/send-reset-mail
and will have theemail
in the body of the request.In Backend when the request is made
token
will be needed in the next stageUser clicks on the link in the mail
They will be redirected to the reset password page. Now when the user enters the new password and confirms it and presses submit. Another
POST
request will be sent to/update-password
so if the URL was
https://iwasat.events/reset.html?token=abc
the output will beabc
i.e the token we need.In Backend when the request is made
user_id
extracted from the token payload is updated.If the response is
200 Ok
then the frontend should redirect it to login page.Minor changes:
utils.py
which contains all the utility functions like encoding jwt, or sending mail