Skip to content
Snippets Groups Projects
Commit 7ed9fdd3 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Added URLs in form of /auth/* for LoginController to conform with the

API specification.
parent cd5a767b
No related merge requests found
...@@ -76,7 +76,7 @@ public class LoginController extends AbstractController { ...@@ -76,7 +76,7 @@ public class LoginController extends AbstractController {
public static final Logger LOGGER = LoggerFactory.getLogger(LoginController.class); public static final Logger LOGGER = LoggerFactory.getLogger(LoginController.class);
@RequestMapping(value = "/doLogin", method = RequestMethod.GET) @RequestMapping(value = { "/auth/login", "/doLogin" }, method = RequestMethod.GET)
public final View doLogin( public final View doLogin(
@RequestParam("type") final String type, @RequestParam("type") final String type,
@RequestParam(value = "user", required = false) final String guestName, @RequestParam(value = "user", required = false) final String guestName,
...@@ -137,13 +137,13 @@ public class LoginController extends AbstractController { ...@@ -137,13 +137,13 @@ public class LoginController extends AbstractController {
return null; return null;
} }
@RequestMapping(value = "/whoami", method = RequestMethod.GET) @RequestMapping(value = { "/auth/", "/whoami" }, method = RequestMethod.GET)
@ResponseBody @ResponseBody
public final User whoami() { public final User whoami() {
return userService.getCurrentUser(); return userService.getCurrentUser();
} }
@RequestMapping(value = "/logout", method = RequestMethod.GET) @RequestMapping(value = { "/auth/logout", "/logout" }, method = RequestMethod.GET)
public final View doLogout(final HttpServletRequest request) { public final View doLogout(final HttpServletRequest request) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication(); Authentication auth = SecurityContextHolder.getContext().getAuthentication();
request.getSession().invalidate(); request.getSession().invalidate();
......
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