diff --git a/backend/chatServer/src/chat/chat.guard.ts b/backend/chatServer/src/chat/chat.guard.ts index 575ecb83..3246cfaf 100644 --- a/backend/chatServer/src/chat/chat.guard.ts +++ b/backend/chatServer/src/chat/chat.guard.ts @@ -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); } }