页面加载时连接中断 - Firefox - Firebase - signInWithPopup()

时间:2016-08-24 18:33:45

标签: javascript facebook firefox firebase firebase-authentication

我目前有一个使用Firebase通过Facebook验证用户身份的网站。我正在使用Firebase JS SDK和signInWithPopup()方法来验证我的用户。

该网站在Chrome上运行良好,但当我的用户尝试使用Firefox登录时,他们会看到以下错误

The connection to wss://s-usc1c-nss-104.firebaseio.com/.ws?v=5&s=Tqa1ImoPipzRYUPJ8vnALN7Fjzda2roZ&ns=my25pics was interrupted while the page was loading.

此错误的可能原因是什么,以及如何或以最快的方式解决此问题?

感谢任何帮助。

谢谢

1 个答案:

答案 0 :(得分:2)

我建议使用signInWithRedirect代替Firefox的signInWithPopup。请注意,在用户重定向回您的网页后,您还需要使用getRedirectResult来获取身份验证结果。

来自Firebase文档:

// Sign in with redirect:
auth.signInWithRedirect(provider)
// The user is redirected to the provider's sign in flow...
// Then redirected back to the app, where we check the redirect result:
auth.getRedirectResult().then(function(result) {
<save authentication results>
});