I am creating a web app using Firebase auth to authenticate my users and a MongoDB database to store some relevant user information specific to my site. I am trying to add F
You can detect if a user is new or existing as follows:
firebase.auth().signInWithPopup(provider) .then(function(result) { console.log(result.additionalUserInfo.isNewUser); }) .catch(function(error) { // Handle error. });
For more on this refer to the documentation.