Is it possible to enable Firebase email authentication but disable sign in?

前端 未结 3 732
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-21 20:12

In my app, I\'m already using the Firebase authentication with Google accounts, but I\'d also like to authorize some users who have no Google account. So I\'d like to manually a

3条回答
  •  Happy的楠姐
    2021-01-21 20:46

    Firebase Auth doesn't provide official tooling to limit email siginup to specific emails, or allow login but disable signup.

    The next best things you could do is

    • Write a cloud function to listen to user creation, and delete them as soon as they are created.
    • Assign custom claim token to the "approved" user account, and only provide access to these user with custom claim token.

    Below is a sample code which limit signup to specific emails https://code.luasoftware.com/tutorials/firebase/setup-firebase-authentication-with-vuejs/

提交回复
热议问题