diff --git a/backend/src/user/user.controller.ts b/backend/src/user/user.controller.ts index b55ea66..f591423 100644 --- a/backend/src/user/user.controller.ts +++ b/backend/src/user/user.controller.ts @@ -27,7 +27,8 @@ export class UserController { // Own user operations @Get("me") @UseGuards(JwtGuard) - async getCurrentUser(@GetUser() user: User) { + async getCurrentUser(@GetUser() user?: User) { + if (!user) return null; const userDTO = new UserDTO().from(user); userDTO.hasPassword = !!user.password; return userDTO;