【问题标题】:how to reset firebase auth password in react native如何在本机反应中重置firebase auth密码
【发布时间】:2019-06-28 03:39:32
【问题描述】:

我想知道如何在我的 react-native 项目中重置 firebase 电子邮件身份验证密码的密码。我喜欢发送电子邮件重置密码。如何使用以下方法做到这一点

  firebase.auth().sendPasswordResetEmail 

【问题讨论】:

    标签: firebase react-native firebase-authentication react-native-android


    【解决方案1】:

     forgotPassword = (Email) => {
        firebase.auth().sendPasswordResetEmail(Email)
          .then(function (user) {
            alert('Please check your email...')
          }).catch(function (e) {
            console.log(e)
          })
      }

    应该为这种忘记密码的方法发送一封电子邮件。

    【讨论】:

      【解决方案2】:

      我认为上面的答案是旧版本,对我来说它不起作用...... 试试这个方法

      import {signInWithEmailAndPassword, sendPasswordResetEmail,} from firebase/auth";
      import { auth,  } from "../config/firebase";
      
      const forgotPassword = (Email) => {
      
          console.log("reset email sent to " + Email);
          sendPasswordResetEmail(auth, Email, null)
              .then(() => {
                  alert("reset email sent to " + Email);
              })
              .catch(function (e) {
                  console.log(e);
              });
      };
      

      这对我有用...

      【讨论】:

        猜你喜欢
        • 2019-05-14
        • 2018-04-07
        • 2021-09-19
        • 2022-01-21
        • 1970-01-01
        • 2018-07-20
        • 2022-06-14
        • 1970-01-01
        • 2019-03-04
        相关资源
        最近更新 更多