HttpServletResponse response, Authentication authentication) throws IOException,
ServletException {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
if (!(auth instanceof AnonymousAuthenticationToken)) {
User user = userModel.getOneByUsername(auth.getName());
if(user.getStatus()==0){
log.info("Banned user:{} tried to login", user.getUsername());
//invalidate authentication
SecurityContextHolder.getContext().setAuthentication(null);
}
request.getSession().setAttribute(USER_ID_SESSION, user.getId());
// request.getSession().setAttribute(USER_ROLE_SESSION, account.getRole().getDisplayName());
// UserInfo userInfo = account.getInfo();
// userInfo.setCurrentIp(request.getRemoteAddr());
// userService.updateInfo(userInfo);
}