feat: rename live chat tester to console

This commit is contained in:
Mohamed Marrouchi
2024-10-22 14:37:42 +01:00
parent a3d7b83511
commit 5218233434
21 changed files with 67 additions and 69 deletions

View File

@@ -209,6 +209,7 @@ export class WebsocketGateway
this.logger.verbose('Client connected, attempting to load session.');
try {
const { searchParams } = new URL(`ws://localhost${client.request.url}`);
if (client.request.headers.cookie) {
const cookies = cookie.parse(client.request.headers.cookie);
if (cookies && config.session.name in cookies) {
@@ -223,7 +224,7 @@ export class WebsocketGateway
'Unable to load session, creating a new one ...',
err,
);
if (searchParams.get('channel') === 'web') {
if (searchParams.get('channel') === 'web-channel') {
return this.createAndStoreSession(client, next);
} else {
return next(new Error('Unauthorized: Unknown session ID'));
@@ -237,7 +238,7 @@ export class WebsocketGateway
return next(new Error('Unable to parse session ID from cookie'));
}
}
} else if (searchParams.get('channel') === 'web') {
} else if (searchParams.get('channel') === 'web-channel') {
return this.createAndStoreSession(client, next);
} else {
return next(new Error('Unauthorized to connect to WS'));