| | |
| | | |
| | | @AuditLoggingInject(type = CONSULTANT_LOGIN) |
| | | @PostMapping("/authenticate/{imgCode}") |
| | | public ResponseEntity<UserJWTController.JWTToken> authorize( |
| | | public void authorize( |
| | | @RequestBody EServiceLoginVM eServiceLoginVM |
| | | , HttpServletResponse response, HttpServletRequest request, |
| | | @PathVariable String imgCode) throws Exception{ |
| | |
| | | ); |
| | | |
| | | Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken); |
| | | consultantService.updateLoginTime(eServiceLoginVM.getUsername()); |
| | | SecurityContextHolder.getContext().setAuthentication(authenticationToken); |
| | | |
| | | String jwt = tokenProvider.createToken(authentication, false); |
| | | HttpHeaders httpHeaders = new HttpHeaders(); |
| | | httpHeaders.add(JWTFilter.AUTHORIZATION_HEADER, "Bearer" + jwt); |
| | | return new ResponseEntity<>(new UserJWTController.JWTToken(jwt), httpHeaders, HttpStatus.OK); |
| | | session.setAttribute("authentication", authentication); |
| | | } |
| | | } |