How to determine if the user signed in to Firebase with email and password or with google sign in?

前端 未结 4 2486
遥遥无期
遥遥无期 2021-02-10 04:30

I am working on a log in for a web application, and I have made it so the user can sign in manually with their email and password or by using a google sign in. Is there a way to

4条回答
  •  北海茫月
    2021-02-10 05:04

    You can determine by using currentUser https://firebase.google.com/docs/reference/js/firebase.UserInfo

    Like this:

    firebase.auth().currentUser.providerData[0].providerId

    Hope this helps.

提交回复
热议问题