I have a PSK (Polymer Starter Kit) PWA build with polymerfire, I want to call fetchSignInMethodsForEmail() from Firebase Auth. I have tried the following but with error.
firebase.auth().fetchSignInMethodsForEmail(email).then((methods) => {
// Do something
});
with the error Uncaught TypeError: firebase.auth(...).fetchSignInMethodsForEmail is not a function.
I have tried the following as well with no luck, i.e.
firebase.auth.fetchSignInMethodsForEmail(email);
firebase.$.auth.fetchSignInMethodsForEmail(email); // Assume firebase-auth with id of 'auth'
For people using the new modular version it's done like this:
import { fetchSignInMethodsForEmail } from 'firebase/auth';
fetchSignInMethodsForEmail(auth, email).then((result) => {
console.log(result);
});
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