用firebase在react本地的firebase上恢复密码null
击中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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论