From 5e312a68d78fffae398f70a03ec47a9a0ff5467a Mon Sep 17 00:00:00 2001 From: Pheuw1 Date: Wed, 15 Mar 2023 21:37:44 +0100 Subject: [PATCH] chat front --- back/volume/src/chat/chat.gateway.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/back/volume/src/chat/chat.gateway.ts b/back/volume/src/chat/chat.gateway.ts index 141d8cd..9c2c895 100644 --- a/back/volume/src/chat/chat.gateway.ts +++ b/back/volume/src/chat/chat.gateway.ts @@ -59,11 +59,8 @@ export class ChatGateway implements OnGatewayConnection, OnGatewayDisconnect { if (channel.banned.find((e) => e.id == connect.UserId) != null) { throw new WsException('You are banned from entering this channel') } - const user = (await this.userService.findUser(connect.UserId)) as User - if ( - channel.users.find((e) => e.id === user.id) == null && - channel.password !== '' - ) { + const user = (await this.userService.findUser(connect.UserId)) as User; + if (channel.password !== "") { if (!(await bcrypt.compare(channel.password, connect.pwd))) { throw new BadRequestException() }