Refactorization and add metrics system.

This commit is contained in:
2019-08-01 22:30:04 +02:00
parent b3942828be
commit b7bfd817e9
19 changed files with 257 additions and 35 deletions
@@ -46,8 +46,16 @@ public class AccountController {
@JsonView(View.UserDTO.class)
@PostMapping("/login")
public User login(@RequestBody final User pUser) throws BadCredentialsException {
return accountService.authenticate(pUser);
public User login(@RequestBody final User pUser, HttpServletResponse pResponse) throws BadCredentialsException {
User result = null;
try {
result = accountService.authenticate(pUser);
} catch(BadCredentialsException ex) {
pResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
}
return result;
}
@GetMapping("/logout")