1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-11-05 07:20:13 +01:00

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

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;