[英]Why doesn't firebase javascript authentication work with ie11?
我已經使用 firebase sdk 在網頁上實現了 google 身份驗證。
它在 chrome、firefox 和 edge 上運行良好,但在 ie11 上我得到了一個谷歌身份驗證頁面,但經過身份驗證的用戶信息始終為空。
我認為它在 ie 11.firebase.google.com/support/guides/environments_js-sdk 中受支持
我通過 cdn 添加了 polyfill 並執行了它,但它不起作用。 用戶信息仍為空。 unpkg.com/core-js-bundle@3.0.1/minified.js
為什么它只適用於 ie11?
*function signInGoogle() {
if (!firebase.auth().currentUser) {
var provider = new firebase.auth.GoogleAuthProvider();
provider.addScope('https://www.googleapis.com/auth/plus.login');
firebase.auth().signInWithRedirect(provider);
} else {
firebase.auth().signOut();
}
}
function initApp() {
firebase.auth().getRedirectResult().then(function (result) {
var user = result.user;
console.log(user); // always null
if (user) {
document.getElementById('createForm').submit();
}
}).catch(function (error) {
var errorCode = error.code;
var errorMessage = error.message;
var email = error.email;
var credential = error.credential;
// [START_EXCLUDE]
if (errorCode === 'auth/account-exists-with-different-credential') {
alert('You have already signed up with a different auth provider for that email.');
} else {
console.error(error);
}
});
}*
為了減小 SDK 大小,Firebase 不再提供某些舊瀏覽器所需的 Polyfil。 這是 6.x 版本中的更改之一。
請查看https://firebase.google.com/support/guides/environments_js-sdk如何根據需要手動啟用 Polyfill 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.