Compare commits
No commits in common. "6376597857eea6dc290e538a778ca954f2edc555" and "e3f35f5525dcc77eb5d92286a42e0a7943cd5090" have entirely different histories.
6376597857
...
e3f35f5525
1 changed files with 1 additions and 5 deletions
|
@ -90,10 +90,6 @@ class GatewayHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleConnection(ws) {
|
handleConnection(ws) {
|
||||||
if (!policies.allowGatewayConnection) {
|
|
||||||
return ws.close(wsCloseCodes.SERVER_DENIED_CONNECTION[0], wsCloseCodes.SERVER_DENIED_CONNECTION[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
const session = new GatewaySession();
|
const session = new GatewaySession();
|
||||||
session.setWebsocketClient(ws);
|
session.setWebsocketClient(ws);
|
||||||
session.send("HELLO", { pingInterval: clientFacingPingInterval });
|
session.send("HELLO", { pingInterval: clientFacingPingInterval });
|
||||||
|
@ -150,7 +146,7 @@ class GatewayHandler {
|
||||||
|
|
||||||
// Gateway message handlers
|
// Gateway message handlers
|
||||||
async handle_YOO({ data }, session) {
|
async handle_YOO({ data }, session) {
|
||||||
if (session.authenticated || !Array.isArray(data.roles) || data.roles.length > 10 || data.roles.) return {error: wsCloseCodes.PAYLOAD_ERROR};
|
if (session.authenticated) return {error: wsCloseCodes.PAYLOAD_ERROR};
|
||||||
try {
|
try {
|
||||||
if (!(await session.authenticateWithToken(data.token))) return {error: wsCloseCodes.AUTHENTICATION_ERROR};
|
if (!(await session.authenticateWithToken(data.token))) return {error: wsCloseCodes.AUTHENTICATION_ERROR};
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
|
Reference in a new issue