Always catch freemarker errors

This commit is contained in:
Joseph Garrone
2021-04-01 23:42:31 +02:00
parent 183ae98c30
commit 85f9544754
8 changed files with 507 additions and 119 deletions

View File

@ -53,8 +53,8 @@
"evt": "2.0.0-beta.15", "evt": "2.0.0-beta.15",
"minimal-polyfills": "^2.1.6", "minimal-polyfills": "^2.1.6",
"path": "^0.12.7", "path": "^0.12.7",
"powerhooks": "^0.0.27", "powerhooks": "^0.0.32",
"scripting-tools": "^0.19.13", "scripting-tools": "^0.19.13",
"tss-react": "^0.0.11" "tss-react": "^0.0.12"
} }
} }

View File

@ -1,116 +1,261 @@
<script>const _= <script>const _=
{ {
"url": (function (){ "url": {
"loginAction": (function (){
<#if url?has_content> <#attempt>
return "${url.loginAction?no_esc}";
<#recover>
</#attempt>
return { })(),
"loginAction": "${(url.loginAction!'')?no_esc}", "resourcesPath": (function (){
"resourcesPath": "${(url.resourcesPath!'')?no_esc}",
"resourcesCommonPath": "${(url.resourcesCommonPath!'')?no_esc}",
"loginRestartFlowUrl": "${(url.loginRestartFlowUrl!'')?no_esc}",
"loginUrl": "${(url.loginUrl!'')?no_esc}"
};
</#if> <#attempt>
return "${url.resourcesPath?no_esc}";
<#recover>
</#attempt>
return undefined; })(),
"resourcesCommonPath": (function (){
})(), <#attempt>
return "${url.resourcesCommonPath?no_esc}";
<#recover>
</#attempt>
})(),
"loginRestartFlowUrl": (function (){
<#attempt>
return "${url.loginRestartFlowUrl?no_esc}";
<#recover>
</#attempt>
})(),
"loginUrl": (function (){
<#attempt>
return "${url.loginUrl?no_esc}";
<#recover>
</#attempt>
})()
},
"realm": { "realm": {
"displayName": "${realm.displayName!''}" || undefined, "displayName": (function (){
"displayNameHtml": "${realm.displayNameHtml!''}" || undefined,
"internationalizationEnabled": ${(realm.internationalizationEnabled!false)?c}, <#attempt>
"registrationEmailAsUsername": ${(realm.registrationEmailAsUsername!false)?c}, return "${realm.displayName!''}" || undefined;
<#recover>
</#attempt>
})(),
"displayNameHtml": (function (){
<#attempt>
return "${realm.displayNameHtml!''}" || undefined;
<#recover>
</#attempt>
})(),
"internationalizationEnabled": (function (){
<#attempt>
return ${realm.internationalizationEnabled?c};
<#recover>
</#attempt>
})(),
"registrationEmailAsUsername": (function (){
<#attempt>
return ${realm.registrationEmailAsUsername?c};
<#recover>
</#attempt>
})()
}, },
"locale": (function (){ "locale": (function (){
<#if realm.internationalizationEnabled> <#attempt>
<#if realm.internationalizationEnabled>
return { return {
"supported": (function(){ "supported": (function(){
var out= []; var out= [];
<#list locale.supported as lng> <#attempt>
out.push({ <#list locale.supported as lng>
"url": "${lng.url?no_esc}", out.push({
"label": "${lng.label}", "url": (function (){
"languageTag": "${lng.languageTag}"
});
</#list>
return out; <#attempt>
return "${lng.url?no_esc}";
<#recover>
</#attempt>
})(), })(),
"current": "${locale.current}" "label": (function (){
};
</#if> <#attempt>
return "${lng.label}";
<#recover>
</#attempt>
return undefined; })(),
"languageTag": (function (){
<#attempt>
return "${lng.languageTag}";
<#recover>
</#attempt>
})()
});
</#list>
<#recover>
</#attempt>
return out;
})(),
"current": (function (){
<#attempt>
return "${locale.current}";
<#recover>
</#attempt>
})()
};
</#if>
<#recover>
</#attempt>
})(), })(),
"auth": (function (){ "auth": (function (){
<#attempt>
<#if auth?has_content> <#if auth?has_content>
var out= { var out= {
"showUsername": ${auth.showUsername()?c}, "showUsername": (function (){
"showResetCredentials": ${auth.showResetCredentials()?c},
"showTryAnotherWayLink": ${auth.showTryAnotherWayLink()?c}, <#attempt>
return ${auth.showUsername()?c};
<#recover>
</#attempt>
})(),
"showResetCredentials": (function (){
<#attempt>
return ${auth.showResetCredentials()?c};
<#recover>
</#attempt>
})(),
"showTryAnotherWayLink": (function(){
<#attempt>
return ${auth.showTryAnotherWayLink()?c};
<#recover>
</#attempt>
})()
}; };
<#attempt>
<#if auth.showUsername() && !auth.showResetCredentials()> <#if auth.showUsername() && !auth.showResetCredentials()>
Object.assign( Object.assign(
out, out,
{ {
"attemptedUsername": "${auth.attemptedUsername}" "attemptedUsername": (function (){
<#attempt>
return "${auth.attemptedUsername}";
<#recover>
</#attempt>
})()
} }
); );
</#if> </#if>
<#recover>
</#attempt>
return out; return out;
</#if> </#if>
<#recover>
return undefined; </#attempt>
})(), })(),
"scripts": (function(){ "scripts": (function(){
var out = []; var out = [];
<#if scripts??> <#attempt>
<#list scripts as script> <#if scripts??>
out.push("${script}"); <#attempt>
</#list> <#list scripts as script>
</#if> out.push((function (){
<#attempt>
return "${script}";
<#recover>
</#attempt>
})());
</#list>
<#recover>
</#attempt>
</#if>
<#recover>
</#attempt>
return out; return out;
})(), })(),
"message": (function (){ "message": (function (){
<#if message?has_content> <#attempt>
<#if message?has_content>
return {  return { 
"type": "${message.type}", "type": (function (){
"summary": String.htmlUnescape("${message.summary}")
};
</#if> <#attempt>
return "${message.type}";
<#recover>
</#attempt>
return undefined; })(),
"summary": (function (){
<#attempt>
return String.htmlUnescape("${message.summary}");
<#recover>
</#attempt>
})()
};
</#if>
<#recover>
</#attempt>
})(), })(),
"isAppInitiatedAction": (function (){ "isAppInitiatedAction": (function (){
<#if isAppInitiatedAction??> <#attempt>
return true; <#if isAppInitiatedAction??>
</#if> return true;
</#if>
<#recover>
</#attempt>
return false; return false;
})() })()

View File

@ -2,13 +2,21 @@
{ {
"client": (function (){ "client": (function (){
<#attempt>
<#if client??> <#if client??>
return { return {
"baseUrl": "${(client.baseUrl!'')?no_esc}" || undefined "baseUrl": (function (){
<#attempt>
return "${(client.baseUrl!'')?no_esc}" || undefined;
<#recover>
</#attempt>
})()
}; };
</#if> </#if>
<#recover>
return undefined; </#attempt>
})() })()
} }

View File

@ -1,37 +1,82 @@
<script>const _= <script>const _=
{ {
"messageHeader": "${messageHeader!''}" || undefined, "messageHeader": (function (){
<#attempt>
return "${messageHeader!''}" || undefined;
<#recover>
</#attempt>
})(),
"requiredActions": (function (){ "requiredActions": (function (){
<#attempt>
<#if requiredActions??> <#if requiredActions??>
var out =[]; var out =[];
<#attempt>
<#list requiredActions> <#list requiredActions>
<#attempt>
<#items as reqActionItem> <#items as reqActionItem>
out.push("${reqActionItem}"); out.push((function (){
</#items></b>
<#attempt>
return "${reqActionItem}";
<#recover>
</#attempt>
})());
</#items>
<#recover>
</#attempt>
</#list> </#list>
<#recover>
</#attempt>
return out; return out;
<#else> </#if>
<#recover>
return undefined; </#attempt>
})(), })(),
"skipLink": (function (){ "skipLink": (function (){
<#attempt>
<#if skipLink??> <#if skipLink??>
return true; return true;
</#if> </#if>
<#recover>
</#attempt>
return false; return false;
})(), })(),
"pageRedirectUri": "${(pageRedirectUri!'')?no_esc}" || undefined, "pageRedirectUri": (function (){
"actionUri": "${(actionUri!'')?no_esc}" || undefined,
<#attempt>
return "${(pageRedirectUri!'')?no_esc}" || undefined;
<#recover>
</#attempt>
})(),
"actionUri": (function (){
<#attempt>
return "${(actionUri!'')?no_esc}" || undefined;
<#recover>
</#attempt>
})(),
"client": { "client": {
"baseUrl": "${(client.baseUrl!'')?no_esc}" || undefined "baseUrl": (function(){
<#attempt>
return "${(client.baseUrl!'')?no_esc}" || undefined;
<#recover>
</#attempt>
})()
} }
} }
</script> </script>

View File

@ -1,7 +1,14 @@
<script>const _= <script>const _=
{ {
"realm": { "realm": {
"loginWithEmailAllowed": ${realm.loginWithEmailAllowed?c} "loginWithEmailAllowed": (function (){
},
<#attempt>
return ${realm.loginWithEmailAllowed?c};
<#recover>
</#attempt>
})()
}
} }
</script> </script>

View File

@ -1,83 +1,160 @@
<script>const _= <script>const _=
{ {
"url": { "url": {
"loginResetCredentialsUrl": "${url.loginResetCredentialsUrl?no_esc}", "loginResetCredentialsUrl": (function (){
"registrationUrl": "${url.registrationUrl?no_esc}" <#attempt>
return "${url.loginResetCredentialsUrl?no_esc}";
<#recover>
</#attempt>
})(),
"registrationUrl": (function (){
<#attempt>
return "${url.registrationUrl?no_esc}";
<#recover>
</#attempt>
})()
}, },
"realm": { "realm": {
"loginWithEmailAllowed": ${realm.loginWithEmailAllowed?c}, "loginWithEmailAllowed": (function(){
"rememberMe": ${realm.rememberMe?c}, <#attempt>
"password": ${realm.password?c}, return ${realm.loginWithEmailAllowed?c};
"resetPasswordAllowed": ${realm.resetPasswordAllowed?c}, <#recover>
"registrationAllowed": ${realm.registrationAllowed?c} </#attempt>
})(),
"rememberMe": (function (){
<#attempt>
return ${realm.rememberMe?c};
<#recover>
</#attempt>
})(),
"password": (function (){
<#attempt>
return ${realm.password?c};
<#recover>
</#attempt>
})(),
"resetPasswordAllowed": (function (){
<#attempt>
return ${realm.resetPasswordAllowed?c};
<#recover>
</#attempt>
})(),
"registrationAllowed": (function (){
<#attempt>
return ${realm.registrationAllowed?c};
<#recover>
</#attempt>
})()
}, },
"auth": (function (){ "auth": (function (){
<#attempt>
<#if auth?has_content> <#if auth?has_content>
var out= { return {
"selectedCredential": "${auth.selectedCredential!''}" || undefined "selectedCredential": (function (){
<#attempt>
return "${auth.selectedCredential!''}" || undefined;
<#recover>
</#attempt>
})()
}; };
return out;
</#if> </#if>
<#recover>
return undefined; </#attempt>
})(), })(),
"social": { "social": {
"displayInfo": ${social.displayInfo?c}, "displayInfo": (function (){
<#attempt>
return ${social.displayInfo?c};
<#recover>
</#attempt>
})(),
"providers": (()=>{ "providers": (()=>{
<#attempt>
<#if social.providers??> <#if social.providers??>
var out= []; var out= [];
<#attempt>
<#list social.providers as p> <#list social.providers as p>
out.push({ out.push({
"loginUrl": "${p.loginUrl?no_esc}", "loginUrl": (function (){
"alias": "${p.alias}", <#attempt>
"providerId": "${p.providerId}", return "${p.loginUrl?no_esc}";
"displayName": "${p.displayName}" <#recover>
</#attempt>
})(),
"alias": (function (){
<#attempt>
return "${p.alias}";
<#recover>
</#attempt>
})(),
"providerId": (function (){
<#attempt>
return "${p.providerId}";
<#recover>
</#attempt>
})(),
"displayName": (function (){
<#attempt>
return "${p.displayName}";
<#recover>
</#attempt>
})()
}); });
</#list> </#list>
<#recover>
</#attempt>
return out; return out;
</#if> </#if>
<#recover>
return undefined; </#attempt>
})() })()
}, },
"usernameEditDisabled": (function () { "usernameEditDisabled": (function () {
<#attempt>
<#if usernameEditDisabled??> <#if usernameEditDisabled??>
return true; return true;
</#if> </#if>
<#recover>
</#attempt>
return false; return false;
})(), })(),
"login": { "login": {
"username": "${login.username!''}" || undefined, "username": (function (){
<#attempt>
return "${login.username!''}" || undefined;
<#recover>
</#attempt>
})(),
"rememberMe": (function (){ "rememberMe": (function (){
<#attempt>
<#if login.rememberMe??> <#if login.rememberMe??>
return true; return true;
</#if> </#if>
<#recover>
</#attempt>
return false; return false;
})() })()
}, },
"registrationDisabled": (function (){ "registrationDisabled": (function (){
<#attempt>
<#if registrationDisabled??> <#if registrationDisabled??>
return true; return true;
</#if> </#if>
<#recover>
</#attempt>
return false; return false;
})() })()
} }
</script> </script>

View File

@ -1,46 +1,152 @@
<script>const _= <script>const _=
{ {
"url": { "url": {
"registrationAction": "${url.registrationAction?no_esc}" "registrationAction": (function (){
<#attempt>
return "${url.registrationAction?no_esc}";
<#recover>
</#attempt>
})()
}, },
"messagesPerField": { "messagesPerField": {
"printIfExists": function (key, x) { "printIfExists": function (key, x) {
switch(key){ switch(key){
case "userLabel": "${messagesPerField.printIfExists('userLabel','1')}" ? x : undefined; case "userLabel": return (function (){
case "username": "${messagesPerField.printIfExists('username','1')}" ? x : undefined;
case "email": "${messagesPerField.printIfExists('email','1')}" ? x : undefined; <#attempt>
case "firstName": "${messagesPerField.printIfExists('firstName','1')}" ? x : undefined; return "${messagesPerField.printIfExists('userLabel','1')}" ? x : undefined;
case "lastName": "${messagesPerField.printIfExists('lastName','1')}" ? x : undefined; <#recover>
case "password": "${messagesPerField.printIfExists('password','1')}" ? x : undefined; </#attempt>
case "password-confirm": "${messagesPerField.printIfExists('password-confirm','1')}" ? x : undefined;
})();
case "username": return (function (){
<#attempt>
return "${messagesPerField.printIfExists('username','1')}" ? x : undefined;
<#recover>
</#attempt>
})();
case "email": return (function (){
<#attempt>
return "${messagesPerField.printIfExists('email','1')}" ? x : undefined;
<#recover>
</#attempt>
})();
case "firstName": return (function (){
<#attempt>
return "${messagesPerField.printIfExists('firstName','1')}" ? x : undefined;
<#recover>
</#attempt>
})();
case "lastName": return (function (){
<#attempt>
return "${messagesPerField.printIfExists('lastName','1')}" ? x : undefined;
<#recover>
</#attempt>
})();
case "password": return (function (){
<#attempt>
return "${messagesPerField.printIfExists('password','1')}" ? x : undefined;
<#recover>
</#attempt>
})();
case "password-confirm": return (function (){
<#attempt>
return "${messagesPerField.printIfExists('password-confirm','1')}" ? x : undefined;
<#recover>
</#attempt>
})();
} }
} }
}, },
"register": { "register": {
"formData": { "formData": {
"firstName": "${register.formData.firstName!''}" || undefined, "firstName": (function (){
"displayName": "${register.formData.displayName!''}" || undefined,
"lastName": "${register.formData.lastName!''}" || undefined, <#attempt>
"email": "${register.formData.email!''}" || undefined, return "${register.formData.firstName!''}" || undefined;
"username": "${register.formData.username!''}" || undefined <#recover>
</#attempt>
})(),
"displayName": (function (){
<#attempt>
return "${register.formData.displayName!''}" || undefined;
<#recover>
</#attempt>
})(),
"lastName": (function (){
<#attempt>
return "${register.formData.lastName!''}" || undefined;
<#recover>
</#attempt>
})(),
"email": (function(){
<#attempt>
return "${register.formData.email!''}" || undefined;
<#recover>
</#attempt>
})(),
"username": (function (){
<#attempt>
return "${register.formData.username!''}" || undefined;
<#recover>
</#attempt>
})()
} }
}, },
"passwordRequired": (function (){ "passwordRequired": (function (){
<#attempt>
<#if passwordRequired??> <#if passwordRequired??>
return true; return true;
</#if> </#if>
<#recover>
</#attempt>
return false; return false;
})(), })(),
"recaptchaRequired": (function (){ "recaptchaRequired": (function (){
<#attempt>
<#if passwordRequired??> <#if passwordRequired??>
return true; return true;
</#if> </#if>
<#recover>
</#attempt>
return false; return false;
})(), })(),
"recaptchaSiteKey": "${recaptchaSiteKey!''}" || undefined "recaptchaSiteKey": (function (){
<#attempt>
return "${recaptchaSiteKey!''}" || undefined;
<#recover>
</#attempt>
})()
} }
</script> </script>

View File

@ -747,10 +747,10 @@ path@^0.12.7:
process "^0.11.1" process "^0.11.1"
util "^0.10.3" util "^0.10.3"
powerhooks@^0.0.27: powerhooks@^0.0.32:
version "0.0.27" version "0.0.32"
resolved "https://registry.yarnpkg.com/powerhooks/-/powerhooks-0.0.27.tgz#e9dc29258860d2f6bf32b249d9cba07c6f53f393" resolved "https://registry.yarnpkg.com/powerhooks/-/powerhooks-0.0.32.tgz#a6aa19573b22f38f4f0bb44573c3242116e9eed1"
integrity sha512-ohayWhtIEdLqiC2th/GEhaRfOhqekFg2uFo0JZ8Dn7oTnAZybs618QJeq5ag9oy3lFVzl+kbROpVa8Ch5zrkaA== integrity sha512-atxsb/zcN8O72hqtfz6tv4XLlh4X22+iTO96PPKpa//nrdvX8KTpFoGiUTh+RQ9RONdR4hP/RmfsDu1zPp2G8Q==
dependencies: dependencies:
evt "2.0.0-beta.15" evt "2.0.0-beta.15"
memoizee "^0.4.15" memoizee "^0.4.15"
@ -927,10 +927,10 @@ to-fast-properties@^2.0.0:
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=
tss-react@^0.0.11: tss-react@^0.0.12:
version "0.0.11" version "0.0.12"
resolved "https://registry.yarnpkg.com/tss-react/-/tss-react-0.0.11.tgz#1cd061927744cd4fc9b7346e2fd1cfcf896a18d5" resolved "https://registry.yarnpkg.com/tss-react/-/tss-react-0.0.12.tgz#6463617ae5e7f670742e48e497d8825d59e2a2e9"
integrity sha512-j8CDpHHIl6S6/mX+AmK08v7waPqwgNA7urHOD3qknCgbY79LRlS7he5DF4NUNE/5B4/Btc3F25w+KqgChNbyGw== integrity sha512-oHekukqdaE71uhHx4XEdHy6aMnDYhoHLWB94iy2Fy9X8btH2lJH1joPj0zS1q7+1Xy2TydkLEZsTq3ElVd7ZqA==
dependencies: dependencies:
"@emotion/css" "^11.1.3" "@emotion/css" "^11.1.3"