javascript - firebase.auth().signInWithEmailAndPassword 既不触发承诺也不捕捉错误
问题描述
我们正在使用 Firebase v4.12.0 和 Cordova。
firebase.auth().signInWithEmailAndPassword
有时(经常)不会触发任何东西:既不是承诺也不是错误。它被卡住了。
当它按预期触发时,我们可以看到对 的请求googleapis.com
,但是当它被卡住时,没有发出任何请求。
这似乎只在 iOS 上发生了几个星期。在过去的 5 年里没有发生过一次......
这是代码:
var config = {
apiKey: "myapikey",
authDomain: "myapp.firebaseapp.com",
databaseURL: "https://myapp.firebaseio.com"
};
firebase.initializeApp(config);
firebase.auth().signInWithEmailAndPassword("email@domain.com", "password")
.then(function(firebaseUser) {
if (firebaseUser) {
console.log("logged !");
} else {
console.log("User is logged out");
}
})
.catch(function(error) {
if (error) {
console.log("error : "+JSON.stringify(error));
}
});
这是一个已知的问题?如何调试并找到有关它的更多信息?
解决方案
推荐阅读
- html - 边界问题
- python - 平均数组中的值对应于另一个数组的值
- objective-c - 使用 Swift 从父 pod 导入 Objective-C 供应商框架(用于混合项目)
- python - 使用 df 到 excel 时,多页不断出错,1 页可以正常工作
- angular - 与 Angular 2+ AuthGuard 一起使用时,Ons Tabbar 混乱
- windows - Electron 中的 Windows 应用程序预览上下文菜单
- laravel-5 - 如何在 Laravel 5 中重命名 Redis 命令?
- javascript - 制作一个JS函数来删除某个元素
- android - 如何在标题栏中保持选项菜单打开?
- node.js - Socket IO 节点 Angular 聊天服务