Reputation: 3523
Following listener is used to detect if a user is logged in,
firebase.auth().onAuthStateChanged(function(user){})
is there a way to determine if the user is created with
createUserWithEmailAndPassword()
or due to a login with:
signInWithEmailAndPassword()
Thanks,
Upvotes: 0
Views: 62
Reputation: 12813
After createUserWithEmailAndPassword()
user.emailVerified is false
After signInWithEmailAndPassword() (assuming the user has verfied their email)
user.emailVerified is true
Upvotes: 1