fix undefined reference

This commit is contained in:
ansuz 2017-05-05 15:20:41 +02:00
parent 6909f663b6
commit 3a338e0890

View file

@ -134,15 +134,6 @@ define([
return ret;
};
var requestLogin = function () {
// log out so that you don't go into an endless loop...
Cryptpad.logout();
// redirect them to log in, and come back when they're done.
sessionStorage.redirectTo = window.location.href;
window.location.href = '/login/';
};
var tryParsing = function (x) {
try { return JSON.parse(x); }
catch (e) {
@ -162,6 +153,15 @@ define([
f(void 0, store);
}
var requestLogin = function (Cryptpad) {
// log out so that you don't go into an endless loop...
Cryptpad.logout();
// redirect them to log in, and come back when they're done.
sessionStorage.redirectTo = window.location.href;
window.location.href = '/login/';
};
if (Cryptpad.isLoggedIn()) {
/* This isn't truly secure, since anyone who can read the user's object can
set their local loginToken to match that in the object. However, it exposes