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

Commit

Permalink
Direct parameter check
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKampf committed Aug 8, 2023
1 parent aaa2e7d commit c66e9a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nextmagentacloud21/core/js/login/consentlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const checkIsRedirectUrl = function () {
return urlParams.has('redirect_url');
};

const checkIsDirectLogin = function () {
return urlParams.has('direct') && urlParams.get('direct') === '2';
}

//Add event listener to the consentChanged event. When the consent is given, redirect to Telekom Login
if (checkIsLoginPage()) {
window.addEventListener("consentChanged", function () {
Expand All @@ -26,7 +30,8 @@ if (checkIsLoginPage()) {
//If the page is loaded with consent given, redirect to Telekom Login
if ("object" === typeof utag &&
"object" === typeof utag.gdpr &&
utag.gdpr.getConsentState() !== 0) {
utag.gdpr.getConsentState() !== 0 &&
!checkIsDirectLogin()) {
//Redirect to Telekom Login
redirectToTelekomLogin();
}
Expand Down

0 comments on commit c66e9a0

Please sign in to comment.