|  |  |  | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | User user; | 
|---|
|  |  |  | if (WHITE_KEY.contains(access_token)) { | 
|---|
|  |  |  | user = userService.getByUsername("openapi", 2L); | 
|---|
|  |  |  | user = userService.getByUsername("root", 1L); | 
|---|
|  |  |  | if (user == null) { | 
|---|
|  |  |  | throw new UsernameNotFoundException("Username not found"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | userService.setUserAuthInfo(user); | 
|---|
|  |  |  | List<Menu> authorities = user.getAuthorities().stream() | 
|---|
|  |  |  | .filter(m -> !Cools.isEmpty(m.getAuthority())).collect(Collectors.toList()); | 
|---|
|  |  |  | UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( | 
|---|
|  |  |  | 
|---|
|  |  |  | if (user == null) { | 
|---|
|  |  |  | throw new UsernameNotFoundException("Username not found"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | userService.setUserAuthInfo(user); | 
|---|
|  |  |  | List<Menu> authorities = user.getAuthorities().stream() | 
|---|
|  |  |  | .filter(m -> !Cools.isEmpty(m.getAuthority())).collect(Collectors.toList()); | 
|---|
|  |  |  | UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( | 
|---|