|
@ -59,11 +59,8 @@ export class ChatGateway implements OnGatewayConnection, OnGatewayDisconnect { |
|
|
if (channel.banned.find((e) => e.id == connect.UserId) != null) { |
|
|
if (channel.banned.find((e) => e.id == connect.UserId) != null) { |
|
|
throw new WsException('You are banned from entering this channel') |
|
|
throw new WsException('You are banned from entering this channel') |
|
|
} |
|
|
} |
|
|
const user = (await this.userService.findUser(connect.UserId)) as User |
|
|
const user = (await this.userService.findUser(connect.UserId)) as User; |
|
|
if ( |
|
|
if (channel.password !== "") { |
|
|
channel.users.find((e) => e.id === user.id) == null && |
|
|
|
|
|
channel.password !== '' |
|
|
|
|
|
) { |
|
|
|
|
|
if (!(await bcrypt.compare(channel.password, connect.pwd))) { |
|
|
if (!(await bcrypt.compare(channel.password, connect.pwd))) { |
|
|
throw new BadRequestException() |
|
|
throw new BadRequestException() |
|
|
} |
|
|
} |
|
|