diff --git a/nextmagentacloud21/core/js/customutils.js b/nextmagentacloud21/core/js/customutils.js index 7efbf619..c80ce67e 100644 --- a/nextmagentacloud21/core/js/customutils.js +++ b/nextmagentacloud21/core/js/customutils.js @@ -616,18 +616,22 @@ function leftSidebarEvents() { window.addEventListener("consentChanged", ()=> redirectToTelekomLogin()); //If the page is loaded with consent given, redirect to Telekom Login -window.onload = function () { - var urlParams = new URLSearchParams(window.location.search); - if( "object" === typeof utag && - "object" === typeof utag.gdpr && - utag.gdpr.getConsentState() !== 0 && - //Check is direct login is not set to 2 - (!urlParams.has('direct') && urlParams.get('direct') !== '2')) { - //Redirect to Telekom Login - redirectToTelekomLogin(); +if(document.getElementById("alternative-logins")){ + window.onload = function () { + var urlParams = new URLSearchParams(window.location.search); + if( "object" === typeof utag && + "object" === typeof utag.gdpr && + utag.gdpr.getConsentState() !== 0 && + //Check is direct login is not set to 2 + (!urlParams.has('direct') && urlParams.get('direct') !== '2')) { + //Redirect to Telekom Login + redirectToTelekomLogin(); + } } } + + function redirectToTelekomLogin(){ //Path to Telekom Login window.location.href = "/apps/user_oidc/login/1";