I am implementing email login in my app and it worked when I setup the project i.e. when I implemented it. I might have deleted some API key in my google console or something but now every time I click on the link inside the emails (verification or reset) I get the message:
Try verifying your email again
Your request to verify your email has expired or the link has already been used
I know this might be a duplicate of this question, however I can't seem to find an answer.
The link of the email I receive has an API key attached. The attached API key does not appear anywhere in my google cloud console. It appears in my firebase console under:
Web API key: the_web_api_key
Therefore the link I receive in the emails looks like this:
https://<appName>.firebaseapp.com/__/auth/action?mode=verifyEmail&oobCode=
<oobCode>&apiKey=<the_web_api_key>
However this the_web_api_key
does not match the apiKey
in my config initialisation object. There you can find the legacy server key:
let config = {
apiKey: legacy_server_key,
authDomain: "<appname>.firebaseapp.com",
databaseURL: "https://<appname>.firebaseio.com",
projectId: "<appname>",
storageBucket: "<appname>",
messagingSenderId: "<senderId>"
}
The legacy server key appears as a server key in my google cloud console.
Maybe that could be the problem? Should I be using the Web Api Key in the initialisation object? I remember this working in the past how it currently is, so I am just confused.
A workaround to reset the password that worked for me was to swap out the old API key with your new API key in the password reset email link.
Get the link from the password reset email it sends you when you reset your password:
https://(PROJECT-ID).firebaseapp.com/__/auth/action?mode=resetPassword&oobCode=DLAe_N4ZmPUA0r7TYa0Il9NCjsc1edkt7F3PouX060UAAAFyPoDCUg&apiKey=(OLD-API-KEY)&lang=en
and update it with the new key:
https://(PROJECT-ID).firebaseapp.com/__/auth/action?mode=resetPassword&oobCode=DLAe_N4ZmPUA0r7TYa0Il9NCjsc1edkt7F3PouX060UAAAFyPoDCUg&apiKey=(NEW-API-KEY)&lang=en
You can find your API key in Google's console: https://console.cloud.google.com/home/dashboard?folder=&organizationId=&project=(PROJECT-ID)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With