Firebase身份验证引发错误:TypeError:无法读取未定义的属性“ length”

时间:2019-12-16 11:33:33

标签: javascript reactjs firebase firebase-realtime-database firebase-authentication

我正在尝试将Firebase实时数据库集成到我的应用程序中。我已启用firebase db中的规则,说只有经过身份验证的用户才能访问数据。我已在Firebase身份验证设置中同时启用了使用google和signInWithCustomToken选项登录。

当我触发signInWithPopUp / SignInWithCustomToken操作时,对Firebase服务器的身份验证调用已成功完成,状态为200。但是Firebase SDK抛出错误,提示 TypeError:无法读取未定义的属性'length'

firebaseApp.auth().signInWithCustomToken(token)
.then(() => {
  console.log('user signed in firebase');
}, (err) => {
  console.error('Failed to authenticate user with firebase ', err, token);
});

Authentication call to firebase server got succeed

error after authentication done appears in console

这是引发错误的代码,我100%确信该代码不是我的,我相信它来自firebase sdk enter image description here

我在此问题上苦苦挣扎了2天,找不到任何解决方案,我们将不胜感激。

0 个答案:

没有答案