0

I have created following code structure as like and file:

firebase.js app initialized with appropriate header files. also, auth exported with appropriate header file.

sigin.js here i have called out the auth from firebase.js

there, in a function i used following code to check:

auth.signWithEmailAndPassword('[email protected]', 'pass123') .then(()=> console.log('user is auth') .catch(err=> console.log(err))

But i am getting post error 400, https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=undefined in my console log. Dear, coders please give some kind suggestions!! Thanks

1 Answer 1

0

You missed a key piece on the call to firebase,

Web API Key

. you can find it under your project settings, and add it to the firebase request.

Also, the firebase documentation gets updated often, and it's a good practice to revisit documentation frequently.

New Post API request for signIn

https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=[API_KEY]

on the body, you can attach the

email,password,return secure token

.

Reference => https://firebase.google.com/docs/reference/rest/auth#section-sign-in-email-password

1
  • 1
    thanks for the instant message, gone through the code and found my firebase api key was not properly connected due to the reference created in my .env file. Now working well!! anyway thanks alot for the review bro! Dec 4, 2020 at 6:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.