gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 14:14:48 24 4
gpt4 key购买 nike

我目前有一个网站,该网站使用 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.

导致此错误的可能原因是什么以及如何或什么是最快的方法来修复它?

感谢任何帮助。

谢谢

最佳答案

我建议使用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>
});

关于javascript - 页面加载时连接中断 - Firefox - Firebase - signInWithPopup(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39130666/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com