I have a firebase powered app. The requirement is to update the account password by typing the currentPassword
and the newPassword
.
On the server (firebase cloud function + admin sdk) i need to check if the provided currentPassword
is valid.
When an account is created for the first time, firebase automatically encrypts the password, and gives me back only the hash.
The problem is - this encryption is done automatically, under the covers.
Without having access to the encryption method, i can't obtain the hash of the currentPassword
in order to compare it to the stored hash of the real password.. to see if this 2 hashes match.
So how can i check if the currentPassword
is valid? How to get access to the same method firebase-auth uses for encryption?
I coudn't find anything relevant so far. am I using the wrong approach here? Why is it so hard to find it ?