We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac1c206 commit d1ca26fCopy full SHA for d1ca26f
1 file changed
backend/src/main/java/org/heymouad/focusapp/controllers/UserController.java
@@ -54,4 +54,12 @@ public ResponseEntity<UserInfoResponse> getUserProfile(@PathVariable String user
54
AppUser user = appUserService.getUserDetails(username);
55
return ResponseEntity.ok(appUserMapper.toUserInfoResponse(user));
56
}
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
65
0 commit comments