mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
fix: error in logs if "allow unauthenticated shares" is enabled
This commit is contained in:
parent
6d87e20e29
commit
c6d8188e4e
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue