用firebase在react本地的firebase上恢复密码null

发布于 2025-02-10 00:07:55 字数 960 浏览 0 评论 0原文

击中firebase的密码重置功能时,我的响应为无效。

  //login with firebase
  const ForgotPasswordRequest = async () => {
    try {
      setIsLoading(true);
      const res = await auth().sendPasswordResetEmail(SignupDetails.email); //email is passing
      console.log(res); // getting null here
      setIsLoading(false);
    } catch (error) {
      setIsLoading(false);
      if (error.code === 'auth/email-already-in-use') {
        alert('That email address is already in use!');
      }

      if (error.code === 'auth/invalid-email') {
        alert('That email address is invalid!');
      }
      if (error.code === 'auth/user-not-found') {
        alert('There is no user record with this email!');
      }
      console.error(error);
    }
  };

这些是我正在使用更新的版本

"@react-native-firebase/app": "^14.2.1",
"@react-native-firebase/auth": "^14.2.1",

:这是在Firebase中存在的电子邮件的成功响应中发生的。在提供错误的电子邮件时,它正在验证并给出错误对象。

I'm getting null in response when hitting password reset function of firebase.

  //login with firebase
  const ForgotPasswordRequest = async () => {
    try {
      setIsLoading(true);
      const res = await auth().sendPasswordResetEmail(SignupDetails.email); //email is passing
      console.log(res); // getting null here
      setIsLoading(false);
    } catch (error) {
      setIsLoading(false);
      if (error.code === 'auth/email-already-in-use') {
        alert('That email address is already in use!');
      }

      if (error.code === 'auth/invalid-email') {
        alert('That email address is invalid!');
      }
      if (error.code === 'auth/user-not-found') {
        alert('There is no user record with this email!');
      }
      console.error(error);
    }
  };

these are the versions i'm using

"@react-native-firebase/app": "^14.2.1",
"@react-native-firebase/auth": "^14.2.1",

Update: This is happening on success response for the email exists in firebase. While on giving wrong email it is authenticating and giving error object.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文