-
Notifications
You must be signed in to change notification settings - Fork 21
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
Forgot Password Component #129
Comments
Hi @rdotjain, I'd like to work on this. Could you assign it to me? |
Yeah, go ahead! |
Hi @rdotjain , I'm still working on this but I'm a little confused and have some questions about the endpoint |
@tchestnut85 yeah, so forgot password button would route to something like |
@rdotjain Got it, thanks! |
Hi @rdotjain , I opened a PR for this but I think for checking if the email verification was successful I need some suggestion on how to check for that correctly. If you're able to take a look when you have time and give some guidance, that would be awesome. |
Reviewed your PR @tchestnut85 ! |
@rdotjain Yes that's what I was thinking, to be able to check that it's verified. Thank you! |
Added an |
So I keep getting 404 errors when making the request to Edit: When using 'POST' I'm getting this message from the response, although I'm sending JSON. const submitEmail = email => fetch(`${URL}${FORGOT_PW_ENDPOINT}`, {
method: 'POST',
body: JSON.stringify(email),
'Content-Type': 'application/json',
}) |
Hey @tchestnut85 , You could try something like this: const submitEmail=(email)=>
{
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"email": email
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
return fetch(`${URL}/api/users/forgot_password/`, requestOptions)
} This is giving the response.status === 200 and a 400 status code if the email is wrong. But the alert is still not being shown. Try this and let us know if it helped! Let us know if you still face an issues. |
I think you not passing the key-value pair in the body and directly passing email as value to the body attribute is making the difference. The rest of the code is almost the same. Also, the |
Thanks @yash22arora ! Adding the headers object and fixing the email key/value pair made it work. |
Great @tchestnut85! If everything's working now, can you generate a PR to be merged in the |
@yash22arora Sure thing, opened PR #141 to be merged to the dev branch. If anything need to be fixed or changed please let me know. Thank you! |
Sure! We'll test it and let you know. |
Server endpoint to request for new password email is
/api/users/forgot_password/
and to set new password is
/api/users/new_password/
Create frontend component for the same.
The text was updated successfully, but these errors were encountered: