How Can I Check user exists in Firebase auth in Signup
Button via react native?
This is my Login Page Code:
export de
For me fetchSignInMethodsForEmail()
only works with an email that is registered with email/password and not working for emails registered with Apple, LinkedIn or other providers.
For solution to this, I came up with following work around:
auth().signInWithEmailAndPassword(email, 'some-random-password') // Password should be really long to avoid actually logging in :)
.then((response) => {
// TODO : Avoid this block
})
.catch((error) => {
if(error.code === 'auth/wrong-password'){
// TODO : If here then it means account already exists...
}
if(error.code === 'auth/user-not-found'){
// TODO : If here then you guessed it... you can create a new account.
}
})
I'm sure there is a proper solution for this and I will update this answer when I find it.
Hope this will help someone