Skip to content
Snippets Groups Projects
Commit d74b6f57 authored by Julian Hochstetter's avatar Julian Hochstetter
Browse files

add @ResponseBody Annotation to whoami action

parent 804a6da8
Branches
Tags
No related merge requests found
...@@ -46,6 +46,7 @@ import org.springframework.stereotype.Controller; ...@@ -46,6 +46,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.View; import org.springframework.web.servlet.View;
import org.springframework.web.servlet.view.RedirectView; import org.springframework.web.servlet.view.RedirectView;
...@@ -110,6 +111,7 @@ public class LoginController { ...@@ -110,6 +111,7 @@ public class LoginController {
} }
@RequestMapping(method = RequestMethod.GET, value = "/whoami") @RequestMapping(method = RequestMethod.GET, value = "/whoami")
@ResponseBody
public User whoami() { public User whoami() {
return userService.getUser(SecurityContextHolder.getContext().getAuthentication()); return userService.getUser(SecurityContextHolder.getContext().getAuthentication());
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment