javascript - Firebase 电话身份验证 : Is it possible to only check if the telephone exists in Authentication and not Sign Up the user automatically?

标签 javascript firebase authentication google-cloud-platform firebase-authentication

我正在使用 Firebase 电话身份验证和 Javascript。

当用户登录我的应用时,如果 Firebase 中不存在电话号码,则会使用提供的电话在身份验证中创建新用户。是否可以预定义一些用户而不让新用户创建帐户?

提前致谢。

最佳答案

您无法关闭用户注册。不过,您可以部署云功能,在注册后立即自动删除新用户:

exports.deleteNewUser = functions.auth.user().onCreate((userRecord, context) => {
  const uid = userRecord.uid; // The Firebase user.
  admin.auth().deleteUser(uid)
    .then(function() {
      console.log("Successfully deleted user: " + uid);
    })
    .catch(function(error) {
      console.log("Error deleting user:", error);
    });
});

无论如何,如果您在前端使用登录调用而不是注册调用,则无论如何都不应该创建新用户。

关于javascript - Firebase 电话身份验证 : Is it possible to only check if the telephone exists in Authentication and not Sign Up the user automatically?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52388280/

相关文章:

android - FirebaseCrashlytics.getInstance() 在多进程应用程序中崩溃应用程序

python - Django 用户身份验证和呈现由该特定用户创建的内容?

c# - 身份验证 gmail api C# windows phone 8.1

javascript - 用 <br> 替换\n 无效

javascript - react 组件已连接,redux 状态发生变化......但组件没有更新?

javascript - 使用 jquery 定位和移动子元素

javascript - 在 jquery 中切换和切换多个类

python - 存储桶名称必须以数字或字母开头和结尾

firebase - 更改 Firebase 实时数据库数据位置

c# - asp.net 页面认证安全级别