var nfyLoginLink = 'https://digital.rhein-zeitung.de/REST/oauth/authorize?device_id=0&response_type=code&client_id=1882906148&access_type=offline&approval_prompt=force&redirect_uri=https%3A%2F%2Fwww.rhein-zeitung.de%2FREST%2Foauth%2Fclient%2Fauthorize_code'+encodeURIComponent("?target=")+encodeURIComponent(encodeURIComponent(document.location.href.replace(document.location.protocol+"//"+document.location.host, "")));; var nfyPaymentLoginLink = 'https://digital.rhein-zeitung.de/anmelden.html?next=https%3A%2F%2Fdigital.rhein-zeitung.de%2FREST%2Foauth%2Fauthorize%3Fdevice_id%3D0%26response_type%3Dcode%26client_id%3D1882906148%26access_type%3Doffline%26approval_prompt%3Dforce%26redirect_uri%3Dhttps%253A%252F%252Fwww.rhein-zeitung.de%252FREST%252Foauth%252Fclient%252Fauthorize_code'+encodeURIComponent("?target=")+encodeURIComponent(encodeURIComponent(document.location.href.replace(document.location.protocol+"//"+document.location.host, "")));; // jQuery Ready var nfyLoginScriptContent = 'Anmelden'; jQuery(document).ready(function($){ jQuery(".login_redirect_link").each(function(){ var loginHref = jQuery(this).attr("href"); if ( !loginHref ) { loginHref = loginLink; } var redirectUri = loginHref.match(/redirect_uri=([^&]+)/); if ( redirectUri ) { var currentUrl = document.location.href; var newRedirectUri = redirectUri[0] + encodeURIComponent("?target=")+encodeURIComponent(encodeURIComponent(currentUrl.replace(document.location.protocol+"//"+document.location.host, ""))); var newLink = loginHref.replace(redirectUri[0], newRedirectUri); jQuery(this).attr("href", newLink); } }); jQuery(".register_redirect_link").each(function(){ registerHref = registerLink; var currentUrl = document.location.href; //var newRedirectUri = encodeURIComponent("?next=")+encodeURIComponent(currentUrl.replace(document.location.protocol+"//"+document.location.host, "")); var newLink = registerHref + "&next=" + encodeURIComponent(currentUrl); jQuery(this).attr("href", newLink); }); jQuery(".payment_user_guest").removeClass("hide"); if ( jQuery(".singlecommentcontainer .comment.detail").length > 0) { jQuery(".commentbox .login").hide(); } // disable payment for specific products and show login buttons jQuery(".payment_product.login_required").each(function(){ jQuery(this).find(".button.payment_product_next").first().hide(); jQuery(this).find(".payment_product_guest").removeClass("hide"); }); jQuery("#loginline .autologin").each(function(){ var autologinLink = jQuery(this).attr("href"); var currentUrl = document.location.href; var newLink = autologinLink + "&redirect_url=" + encodeURIComponent(currentUrl); jQuery(this).attr("href", newLink); }); if ( typeof nfyLoginScriptContent != "undefined" ) { document.getElementById("nfy_login_src").innerHTML = nfyLoginScriptContent; } }); var isGuest = true; var loginLink = loginLink; // fallback var registerLink = "https://digital.rhein-zeitung.de/index.php?action=register&pageid=3"; var nfySsoDomain = "https://digital.rhein-zeitung.de"; var nfySSoClientId = "1882906148";