diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/header.tag b/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/header.tag index ce8c64f160..97dda8b7c5 100644 --- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/header.tag +++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/header.tag @@ -52,10 +52,24 @@ function setPageTitle(title) { document.title = "${config.topbarTitle} - " + title; } + + function cleanObject(obj) { + if (obj === String(obj)) { + return obj.replace(/<.+>/, ''); + } + + if (obj instanceof Object) { + Object.keys(obj).map(function(key, index) { + obj[key] = cleanObject(obj[key]); + }); + } + + return obj; + } // get the info of the current user, if available (null otherwise) function getUserInfo() { - return ${fn:escapeXml(userInfoJson)}; + return cleanObject(${userInfoJson}); } // get the authorities of the current user, if available (null otherwise)