SSO_MARKER is now standardized

This commit is contained in:
Girish Ramakrishnan
2020-08-08 17:58:04 -07:00
parent 8c8e363abc
commit b9973d69c3

View File

@@ -387,21 +387,13 @@ app.filter('prettyEmailAddresses', function () {
});
app.filter('postInstallMessage', function () {
var SSO_MARKER = '=== sso ===';
return function (text, app) {
if (!text) return '';
if (!app) return text;
var parts = text.split(SSO_MARKER);
if (parts.length === 1) {
// [^] matches even newlines. '?' makes it non-greedy
if (app.sso) return text.replace(/\<nosso\>[^]*?\<\/nosso\>/g, '');
else return text.replace(/\<sso\>[^]*?\<\/sso\>/g, '');
}
if (app.sso) return parts[1];
else return parts[0];
// [^] matches even newlines. '?' makes it non-greedy
if (app.sso) return text.replace(/\<nosso\>[^]*?\<\/nosso\>/g, '');
else return text.replace(/\<sso\>[^]*?\<\/sso\>/g, '');
};
});