我有一个简单的自定义登录页面,使用Firebase。基本上有一个管理页面,JavaScript正在检查当前用户是否通过身份验证。如果没有,它将被重定向到一个登录页面,在认证后将返回到原来的管理员的东西。无法使用Internet Explorer 11登录到Firebase
这是检查验证的脚本:
<script type="text/javascript">
var ref = new Firebase("firebase.linkishere.com ?>");
var authData = ref.getAuth();
if (authData) {
console.log("User is authenticated!");
document.getElementById("container").style.display = "block";
} else {
var login = "login.php";
window.location.href = login;
console.log("I'm not authenticated;")
}
,这是在登录页面上的脚本:
$('#signIn').on("click", function(){
var username = $("#username").val();
var password = $("#password").val();
ref.authWithPassword({
email : username,
password : password
},
function(error, authData) {
if (error) {
switch (error.code) {
case "INVALID_EMAIL":
errorMessage.innerHTML = "The specified user account email is invalid."
console.log("The specified user account email is invalid.");
break;
case "INVALID_PASSWORD":
errorMessage.innerHTML = "The specified user account password is incorrect."
console.log("The specified user account password is incorrect.");
break;
case "INVALID_USER":
errorMessage.innerHTML = "The specified user account does not exist."
console.log("The specified user account does not exist.");
break;
default:
errorMessage.innerHTML = "Error logging user in"
console.log("Error logging user in:", error);
}
} else {
console.log("Authenticated successfully with payload:", authData);
window.location.href = "index.php";
remember: "sessionOnly"
}
});
});
这一切适用于Chrome罚款,火狐,微软优势,但对于在Internet Explorer 11上的一些原因,它不会保持身份验证。我输入我的详细信息,firebase接受它,但随后它跳回到登录页面,并显示一个控制台日志:我没有通过身份验证。
这就像Internet Explorer将不记得页面刷新后,或重定向后的身份验证状态。
我错过了什么?
互联网探险家是老...我只是说。从来没有见过任何人使用这些天, – amanuel2
我不会用棒触摸,但你知道... –