diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/UserControllerCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/UserControllerCE.java index 6a70f26013..039d713dfb 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/UserControllerCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/UserControllerCE.java @@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.codec.multipart.Part; +import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -161,10 +162,8 @@ public class UserControllerCE extends BaseController @JsonView(Views.Public.class) @GetMapping("/me") - public Mono> getUserProfile() { - return sessionUserService - .getCurrentUser() - .flatMap(service::buildUserProfileDTO) + public Mono> getUserProfile(@AuthenticationPrincipal User user) { + return service.buildUserProfileDTO(user) .map(profile -> new ResponseDTO<>(HttpStatus.OK.value(), profile, null)); }