Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKampf committed Jul 10, 2023
1 parent e196468 commit 12a6a2e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nextmagentacloud21/core/js/customutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,17 +612,24 @@ function leftSidebarEvents() {
}

// Tealium

//Add event listener to the consentChanged event. When the consent is given, redirect to Telekom Login
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.href);
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";
}

0 comments on commit 12a6a2e

Please sign in to comment.