diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 6a8cc5875..072a4ef16 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -44,6 +44,18 @@ define([ return; }; + var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) { + realtime.sync(); + var interval = 300; + var check = function () { + if (realtime.getAuthDoc() !== realtime.getUserDoc()) { + return window.setTimeout(check, interval); + } + cb(); + }; + window.setTimeout(check, interval); + }; + var getWebsocketURL = common.getWebsocketURL = function () { if (!Config.websocketPath) { return Config.websocketURL; } var path = Config.websocketPath; diff --git a/www/common/login.js b/www/common/login.js index bf3848c70..99678b1dd 100644 --- a/www/common/login.js +++ b/www/common/login.js @@ -70,6 +70,9 @@ define([ Exports.loginOrRegister = function (uname, passwd, isRegister, cb) { if (typeof(cb) !== 'function') { return; } + // Usernames are all lowercase. No going back on this one + uname = uname.toLowerCase(); + // validate inputs if (!Cred.isValidUsername(uname)) { return void cb('INVAL_USER'); } if (!Cred.isValidPassword(passwd)) { return void cb('INVAL_PASS'); } diff --git a/www/common/toolbar.js b/www/common/toolbar.js index ab09497ae..a9a2435ae 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -465,10 +465,10 @@ define([ window.location.href = '/'; }); $userAdmin.find('a.login').click(function (e) { - window.open('/user'); + window.location.href = '/login/'; }); $userAdmin.find('a.register').click(function (e) { - window.open('/register/'); + window.location.href = '/register/'; }); if (config.userName && config.userName.setName && config.userName.lastName) { diff --git a/www/register/index.html b/www/register/index.html index b11ed07f1..013d6ac10 100644 --- a/www/register/index.html +++ b/www/register/index.html @@ -4,6 +4,7 @@