look up by username instead of subject
parent
9ea82aacf0
commit
b9da10d176
|
@ -88,7 +88,7 @@ public class UserInfoInterceptor extends HandlerInterceptorAdapter {
|
|||
if (p != null && p.getName() != null) { // don't bother checking if we don't have a principal
|
||||
|
||||
// try to look up a user based on the principal's name
|
||||
UserInfo user = userInfoService.getBySubject(p.getName());
|
||||
UserInfo user = userInfoService.getByUsername(p.getName());
|
||||
|
||||
// if we have one, inject it so views can use it
|
||||
if (user != null) {
|
||||
|
|
|
@ -61,11 +61,11 @@ public class UserInfoEndpoint {
|
|||
return "httpCodeView";
|
||||
}
|
||||
|
||||
String userId = p.getName();
|
||||
UserInfo userInfo = userInfoService.getBySubject(userId);
|
||||
String username = p.getName();
|
||||
UserInfo userInfo = userInfoService.getByUsername(username);
|
||||
|
||||
if (userInfo == null) {
|
||||
logger.error("getInfo failed; user not found: " + userId);
|
||||
logger.error("getInfo failed; user not found: " + username);
|
||||
model.addAttribute("code", HttpStatus.NOT_FOUND);
|
||||
return "httpCodeView";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue