diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index a45d5d833..b639eebab 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -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; diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index eb20875bc..530380746 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -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; diff --git a/www/common/outer/local-store.js b/www/common/outer/local-store.js index 4d87a3b21..9b62fbbde 100644 --- a/www/common/outer/local-store.js +++ b/www/common/outer/local-store.js @@ -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) {