look up by username instead of subject

pull/516/head
Justin Richer 11 years ago
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 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 // 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 we have one, inject it so views can use it
if (user != null) { if (user != null) {

@ -61,11 +61,11 @@ public class UserInfoEndpoint {
return "httpCodeView"; return "httpCodeView";
} }
String userId = p.getName(); String username = p.getName();
UserInfo userInfo = userInfoService.getBySubject(userId); UserInfo userInfo = userInfoService.getByUsername(username);
if (userInfo == null) { 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); model.addAttribute("code", HttpStatus.NOT_FOUND);
return "httpCodeView"; return "httpCodeView";
} }

Loading…
Cancel
Save