Skip to content

Commit d1ca26f

Browse files
committed
chore: add logged User
1 parent ac1c206 commit d1ca26f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

backend/src/main/java/org/heymouad/focusapp/controllers/UserController.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,12 @@ public ResponseEntity<UserInfoResponse> getUserProfile(@PathVariable String user
5454
AppUser user = appUserService.getUserDetails(username);
5555
return ResponseEntity.ok(appUserMapper.toUserInfoResponse(user));
5656
}
57+
58+
@GetMapping("/currentUser")
59+
public ResponseEntity<UserInfoResponse> getCurrentUserProfile(Authentication authentication) {
60+
String email = authentication.getName();
61+
AppUser appUser = appUserService.getUserByEmail(email);
62+
return ResponseEntity.ok(appUserMapper.toUserInfoResponse(appUser));
63+
}
64+
5765
}

0 commit comments

Comments
 (0)