【问题标题】:Angular fire auth : delete and logout a specif user with his uidAngular fire auth:使用他的 uid 删除并注销特定用户
【发布时间】:2019-05-06 20:58:42
【问题描述】:

我想从数据库中删除一个用户,所以我也需要注销并从身份验证中删除他。我使用 Angular fire auth,但我也不知道该怎么做:

this.afAuth.auth.currentUser.delete().then(() => {
          this.afAuth.auth.signOut()
        })

带有特定的 uid

【问题讨论】:

  • 真的很想要这个

标签: firebase authentication ionic-framework firebase-authentication angularfire


【解决方案1】:

您可以通过Firebase Admin SDK删除用户:

admin.auth().deleteUser(uid)
  .then(function() {
    console.log("Successfully deleted user");
  })
  .catch(function(error) {
    console.log("Error deleting user:", error);
  });

用户下次尝试获取 ID 令牌或重新加载时,他/她将被注销。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-18
    • 2014-08-08
    • 2016-08-22
    • 1970-01-01
    • 2020-01-01
    • 2021-11-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多