Fix logged in users seen as anonymous in some parts of the code

pull/1/head
yflory 4 years ago
parent b2a84ae3f7
commit 4401c7c519

@ -2484,6 +2484,9 @@ define([
data = data.returned;
}
if (data.loggedIn) {
window.CP_logged_in = true;
}
if (data.anonHash && !cfg.userHash) { LocalStore.setFSHash(data.anonHash); }
initialized = true;

@ -2815,7 +2815,9 @@ define([
store.onRpcReadyEvt = Util.mkEvent(true);
store.loggedIn = typeof(data.userHash) !== "undefined";
var returned = {};
var returned = {
loggedIn: Boolean(data.userHash)
};
rt.proxy.on('create', function (info) {
store.realtime = info.realtime;
store.network = info.network;

@ -73,7 +73,7 @@ define([
};
LocalStore.isLoggedIn = function () {
return typeof getUserHash() === "string";
return window.CP_logged_in || typeof getUserHash() === "string";
};
LocalStore.login = function (hash, name, cb) {

Loading…
Cancel
Save