简体   繁体   中英

I Want To Check If User Exist Before Login If Not They Must Sign Up, In Firebase Google Auth

I have Login and Sign Up functionality using Firebase Google Auth and It works Fine but I want to Check If the user already Signed Up, They can't sign Up 2 times they'll have to Login. is there a Code Like:

if(user.exist){
  alert("Account Already exists please Login")
}else{
  auth.signInWithPopup(provider)
}

And vice versa if they do not exist they'll have to Sign Up:

Is This possible with google auth?

You'll need to know at least part of the user's credentials to check if they already exist in Firebase Authentication.

For example, if the user signed in with a provider that requires their email before, you'll should ask them for their email address next time and then call fetchSignInMethodsForEmail to determine if Firebase already has a user for that email address.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM