mirror of https://github.com/xwiki-labs/cryptpad
Fix race condition with the allow list
This commit is contained in:
parent
f071e2df25
commit
daeae8b74e
www/common/outer
|
@ -1703,6 +1703,8 @@ define([
|
|||
// There is an allow list: check if we can authenticate
|
||||
if (!Array.isArray(allowed)) { return void cb('EINVAL'); }
|
||||
if (!store.loggedIn || !store.proxy.edPublic) { return void cb('EFORBIDDEN'); }
|
||||
|
||||
onReadyEvt.reg(function () {
|
||||
var rpc;
|
||||
var teamModule = store.modules['team'];
|
||||
var teams = (teamModule && teamModule.getTeams()) || [];
|
||||
|
@ -1724,6 +1726,7 @@ define([
|
|||
rpc.send('COOKIE', '', function (err) {
|
||||
cb(err);
|
||||
});
|
||||
});
|
||||
},
|
||||
onConnectionChange: function (info) {
|
||||
if (!info.state) {
|
||||
|
|
|
@ -113,7 +113,6 @@ define([
|
|||
if (!config.store.id && !config.store.network) {
|
||||
Cache.getChannelCache(secret.channel, waitFor(function (err, res) {
|
||||
if (err === "EINVAL") { // Cache not found
|
||||
console.warn(secret.channel);
|
||||
waitFor.abort();
|
||||
store.manager.restrictedProxy(id, secret.channel);
|
||||
// XXX unrestrict when we connect?
|
||||
|
|
Loading…
Reference in New Issue