【发布时间】:2016-09-07 14:32:39
【问题描述】:
我有两个小型网络应用程序,在使用 Firebase 登录后,我正在从第一个应用程序重定向到第二个应用程序。我当前的问题是在新页面加载后身份验证数据未保存并且为空。
var ref = new Firebase("https://xxx.firebaseio.com");
var credentials = {};
credentials.email = email;
credentials.password = password;
ref.authWithPassword(credentials, function(error, authData) {
if (error) {
console.log("Login Failed!", error);
document.getElementById("login-status").innerHTML = error;
} else {
console.log("Authenticated successfully with payload:", authData);
console.log("AuthData expires: " + authData.expires);
window.location = "http://localhost:3000/";
}
});
所以,首先我会正确登录,authData 显示登录详细信息,但在新页面上 http://localhost:3000/ authData 为空。
有人知道如何保持会话吗?我玩弄了remember 对象,但它并没有解决我的问题。
【问题讨论】:
标签: javascript angularjs firebase firebase-authentication