Firebase Auth unable to login after password reset

I have created login screen with forgot password option connected to firebase auth. All is going well till the point when i reset the password and try to login again with new password, then unable to login and got invalid password response. I am able to login with other accounts with no password reset.



You appear to be setting the APIkey in the url twice ?

Do you need to set a header with content-type ?

You could show your full urls as well to help check against the documentation

image

then

image

Removed API from initialize global resetpass, still not able to login with new password.

What does the email look like, ask the user to do ?

[mod edit] screenshot removed

I removed your image because it shows your APi key!

Have just tested the password reset process using curl, and it works OK for me

Send password reset email:

curl 'https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key=apikey' 
-H 'Content-Type: application/json' 
--data-binary '{"requestType":"PASSWORD_RESET","email":"example@gmail.com"}'

Sign In User

curl 'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=apikey'
-H 'Content-Type: application/json'
--data-binary '{"email":"example@gmail.com","password":"newpassword","returnSecureToken":true}'

I am able to login with other accounts whose passwords are not reset, but unable to login with the accounts whose passwords are reset and tried to login with new password. It shows invalid password error. What change should I make to the blocks so that I can login with new password.

These are blocks I have used to sign in a user:

you do have an & missing in front of returnSecureToken=true

Done thanks a lot

All working now ?

You could also modify your email template: Authentication > Templates

For the password reset template:

<p>Hello,</p>
<p>Follow this link to reset your %APP_NAME% password for your %EMAIL% account.</p>
<p><a href='%LINK%'>%LINK%</a></p>
<p>If you didn’t ask to reset your password, you can ignore this email.</p>
<p>Thanks,</p>
<p>Your %APP_NAME% team</p>

change third line to this:

<p>Hello,</p>
<p>Follow this link to reset your %APP_NAME% password for your %EMAIL% account.</p>
<p><a href='%LINK%'>PASSWORD RESET</a></p>
<p>If you didn’t ask to reset your password, you can ignore this email.</p>
<p>Thanks,</p>
<p>Your %APP_NAME% team</p>

Thanks will change the template.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.