【问题标题】:Firebase: How to validate the email address when a user updates his/her email?Firebase:当用户更新他/她的电子邮件时如何验证电子邮件地址?
【发布时间】:2017-12-13 16:45:12
【问题描述】:

我在 Firebase 中遇到错误。当用户在 firebase 中更新他/她的电子邮件时,用户的电子邮件会得到更新,但用户的电子邮件不会得到验证,因此用户无法登录,因为电子邮件无效。当用户在 Firebase 中更新他们的电子邮件时,还有什么需要做的吗?

【问题讨论】:

    标签: firebase firebase-realtime-database firebase-authentication firebase-security firebase-storage


    【解决方案1】:

    似乎可以使用 firebase 中 auth 变量的 currentUser 属性上的 sendEmailVerification 将 verifyEmail 发送到新电子邮件。一个异常情况是,有时邮件同时发送不止一次,链接就会过期。

    `  this.user.updateEmail(email).then(function () {
         auth.currentUser.sendEmailVerification().then(() => {
            this.notificationSystem.addNotification({
              `message`: 'Verify your new email address with the link sent to ' + email,
              level: 'info'
            })
          });`
    

    【讨论】:

      猜你喜欢
      • 2019-11-25
      • 1970-01-01
      • 2014-09-18
      • 2016-11-03
      • 1970-01-01
      • 2012-07-14
      • 2022-01-19
      • 1970-01-01
      • 2014-06-12
      相关资源
      最近更新 更多