Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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'); }
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user