[英]Firebase Authentication: Calling `createUserWithEmailAndPassword` calls `createAuthUri` on error
Calling firebase.auth().createUserWithEmailAndPassword(email, password)
is causing "QUOTA_EXCEEDED : Exceeded quota for email lookup."
调用
firebase.auth().createUserWithEmailAndPassword(email, password)
导致"QUOTA_EXCEEDED : Exceeded quota for email lookup."
if a user tries to create an account with an existing email.如果用户尝试使用现有电子邮件创建帐户。
Here is my code (using "firebase": "7.6.2"
):这是我的代码(使用
"firebase": "7.6.2"
):
firebase.auth().createUserWithEmailAndPassword(email, password)
.then(result => {
result.user.sendEmailVerification(actionCodeSettings);
})
.catch(error => {
console.log(error);
// Handling error for user
});
The error is handled correctly.错误处理正确。 The error is catched with
错误被捕获
"error": {
"code": 400,
"message": "EMAIL_EXISTS",
"errors": [
{
"message": "EMAIL_EXISTS",
"domain": "global",
"reason": "invalid"
}
]
}
}
Nevertheless firebase is calling createAuthUri
to create the URI used by the IdP to authenticate the user.尽管如此,firebase 正在调用
createAuthUri
来创建 IdP 用于对用户进行身份验证的 URI。 This call is triggered in a loop till it runs into the quota.此调用在循环中触发,直到达到配额。 Has anybody the same problem?
有人有同样的问题吗? How can i cancel the calls of
createAuthUri
to avoid to run against the quota?如何取消
createAuthUri
的调用以避免违反配额?
Solved the problem!解决了问题! It was not caused by
firebase.auth().createUserWithEmailAndPassword(email, password)
as I expected.它不是由
firebase.auth().createUserWithEmailAndPassword(email, password)
引起的firebase.auth().createUserWithEmailAndPassword(email, password)
正如我所料。 There is a component triggered to render an alert on error (didn't show that in the snippet).有一个组件被触发以呈现错误警报(未在代码段中显示)。 Inside this component there was the side effect caused by calling firebase on each re-render of the component.
在这个组件内部,每次重新渲染组件时调用 firebase 都会产生副作用。 Unfortunately, the component caused the re-render on each function call to firebase by itself.
不幸的是,该组件在每次调用 firebase 的函数时都会自行重新渲染。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.