| Conditions | 3 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package easytests.common.controllers; |
||
| 25 | @ModelAttribute("currentUserModel") |
||
| 26 | public UserModelInterface getCurrentUserModel() { |
||
| 27 | if (!this.userModelFetched) { |
||
| 28 | final Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); |
||
| 29 | if (!(authentication instanceof AnonymousAuthenticationToken)) { |
||
| 30 | this.userModel = usersService.findByEmail(authentication.getName()); |
||
| 31 | } |
||
| 32 | this.userModelFetched = true; |
||
| 33 | } |
||
| 34 | return this.userModel; |
||
| 35 | } |
||
| 37 |