var nfyLoginLink = 'https://digital.rhein-zeitung.de/REST/oauth/authorize?response_type=code&client_id=1882906148&access_type=offline&approval_prompt=force&redirect_uri=http%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, "")));; // jQuery Ready var nfyLoginScriptContent = ''; 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); }); }); var isGuest = true; var loginLink = nfyLoginLink; // fallback var registerLink = "https://digital.rhein-zeitung.de/index.php?action=register&pageid=3"; var nfySsoDomain = "https://digital.rhein-zeitung.de"; var nfySSoClientId = "1882906148";