mirror of
https://github.com/Yonle/bostr.git
synced 2025-07-08 22:40:08 +02:00
b2: only start connect to relays once authenticated
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
@ -82,6 +82,7 @@ module.exports = (ws, req) => {
|
||||
if (auth(authKey, authorized, authorized_keys, data[1], ws, req)) {
|
||||
ws.pubkey = data[1].pubkey;
|
||||
authorized = true;
|
||||
relays.forEach(_ => newConn(_, ws.id));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -103,7 +104,7 @@ module.exports = (ws, req) => {
|
||||
});
|
||||
|
||||
csess.set(ws.id, ws);
|
||||
relays.forEach(_ => newConn(_, ws.id));
|
||||
if (authorized) relays.forEach(_ => newConn(_, ws.id));
|
||||
}
|
||||
|
||||
// WS - Broadcast message to every existing sockets
|
||||
|
Reference in New Issue
Block a user