1
0
Fork 0

fix: error in logs if "allow unauthenticated shares" is enabled

This commit is contained in:
Elias Schneider 2024-03-25 19:12:27 +01:00
parent 6d87e20e29
commit c6d8188e4e
No known key found for this signature in database
GPG Key ID: 07E623B294202B6C
1 changed files with 2 additions and 1 deletions

View File

@ -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;