made user info interceptor more null safe for client side
parent
3e4aae6c8a
commit
257312d5da
|
@ -82,8 +82,13 @@ public class UserInfoInterceptor extends HandlerInterceptorAdapter {
|
|||
if (p instanceof OIDCAuthenticationToken) {
|
||||
// if they're logging into this server from a remote OIDC server, pass through their user info
|
||||
OIDCAuthenticationToken oidc = (OIDCAuthenticationToken) p;
|
||||
modelAndView.addObject("userInfo", oidc.getUserInfo());
|
||||
modelAndView.addObject("userInfoJson", oidc.getUserInfo().toJson());
|
||||
if (oidc.getUserInfo() != null) {
|
||||
modelAndView.addObject("userInfo", oidc.getUserInfo());
|
||||
modelAndView.addObject("userInfoJson", oidc.getUserInfo().toJson());
|
||||
} else {
|
||||
modelAndView.addObject("userInfo", null);
|
||||
modelAndView.addObject("userInfoJson", "null");
|
||||
}
|
||||
} else {
|
||||
// don't bother checking if we don't have a principal or a userInfoService to work with
|
||||
if (p != null && p.getName() != null && userInfoService != null) {
|
||||
|
|
Loading…
Reference in New Issue