Skip to content

Commit

Permalink
feat: Chat Exception 세분화
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeeeeeh committed Dec 2, 2024
1 parent 8fb89c6 commit a5068ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/chatServer/src/chat/chat.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export class HostGuard implements CanActivate {
const { roomId, userId } = payload;
const hostId = await this.roomService.getHostOfRoom(roomId);
console.log('hostGuard:', hostId, userId);
if (hostId !== userId) throw new ChatException(CHATTING_SOCKET_ERROR.UNAUTHORIZED, roomId);
return hostId === userId;
if (hostId === userId) return true;
throw new ChatException(CHATTING_SOCKET_ERROR.UNAUTHORIZED, roomId);
}
}

Expand Down

0 comments on commit a5068ab

Please sign in to comment.