Skip to content

Commit

Permalink
Merge pull request #65 from weni-ai/feature/logout-from-flows-depende…
Browse files Browse the repository at this point in the history
…nd-on-environment

feat: added flows logout iframe dependend on environment
  • Loading branch information
cristiantela authored Sep 26, 2023
2 parents ea340b9 + 26c924a commit af6c22f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions themes/ilhasoft/login/template.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@
<div class="left-side-content">
<div class="content">
<a href="${url.loginUrl}"><img class="brand-title" src="${url.resourcesPath}/img/login/Logo-Weni.svg"></a>

<iframe src="https://flows.weni.ai/users/logout" style="display: none;"></iframe>

<div>
<div style="position: relative;">
Expand Down Expand Up @@ -447,6 +445,21 @@
if (logRocketId && window.LogRocket) {
window.LogRocket.init(logRocketId);
}
const flowsLogoutURLByRealms = {
"weni": "https://flows.weni.ai/users/logout",
"weni-staging": "https://flows.stg.cloud.weni.ai/users/logout",
"weni-develop": "https://flows.dev.cloud.weni.ai/users/logout",
}
const flowsLogoutURL = flowsLogoutURLByRealms[realm];
if (flowsLogoutURL) {
const iframe = document.createElement('iframe');
iframe.setAttribute('src', flowsLogoutURL);
iframe.setAttribute('style', 'display: none;');
document.body.appendChild(iframe);
}
</script>
</body>
<footer></footer>
Expand Down

0 comments on commit af6c22f

Please sign in to comment.