fix: error in logs if "allow unauthenticated shares" is enabled
This commit is contained in:
@@ -27,7 +27,8 @@ export class UserController {
|
|||||||
// Own user operations
|
// Own user operations
|
||||||
@Get("me")
|
@Get("me")
|
||||||
@UseGuards(JwtGuard)
|
@UseGuards(JwtGuard)
|
||||||
async getCurrentUser(@GetUser() user: User) {
|
async getCurrentUser(@GetUser() user?: User) {
|
||||||
|
if (!user) return null;
|
||||||
const userDTO = new UserDTO().from(user);
|
const userDTO = new UserDTO().from(user);
|
||||||
userDTO.hasPassword = !!user.password;
|
userDTO.hasPassword = !!user.password;
|
||||||
return userDTO;
|
return userDTO;
|
||||||
|
|||||||
Reference in New Issue
Block a user