Browse Source

chat front

master
Pheuw1 2 years ago
parent
commit
5e312a68d7
  1. 7
      back/volume/src/chat/chat.gateway.ts

7
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()
}

Loading…
Cancel
Save