aled
This commit is contained in:
@@ -27,7 +27,9 @@ public class UserInterceptor implements HandlerInterceptor {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (authentication != null && authentication.isAuthenticated() && !authentication.getName().equals("anonymousUser")) {
|
||||
UserProfil user = this.userService.utilisateurByName(authentication.getName());
|
||||
modelAndView.getModelMap().addAttribute("user", user.getCredit());
|
||||
if (modelAndView != null && modelAndView.getViewName() != null && !modelAndView.getViewName().startsWith("redirect:")) {
|
||||
modelAndView.addObject("user", user.getCredit());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
//package fr.eni.enchere.interceptor;
|
||||
//
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
//
|
||||
//public class UserServiceInterceptorAppConfig implements WebMvcConfigurer {
|
||||
//
|
||||
// @Override
|
||||
// public void addInterceptors(InterceptorRegistry registry) {
|
||||
// registry.addInterceptor(new UserInterceptor());
|
||||
// }
|
||||
//}
|
||||
Reference in New Issue
Block a user