Skip to content

Commit a5068ab

Browse files
committed
feat: Chat Exception 세분화
1 parent 8fb89c6 commit a5068ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/chatServer/src/chat/chat.guard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export class HostGuard implements CanActivate {
2323
const { roomId, userId } = payload;
2424
const hostId = await this.roomService.getHostOfRoom(roomId);
2525
console.log('hostGuard:', hostId, userId);
26-
if (hostId !== userId) throw new ChatException(CHATTING_SOCKET_ERROR.UNAUTHORIZED, roomId);
27-
return hostId === userId;
26+
if (hostId === userId) return true;
27+
throw new ChatException(CHATTING_SOCKET_ERROR.UNAUTHORIZED, roomId);
2828
}
2929
}
3030

0 commit comments

Comments
 (0)