PageSourceSearch

https://www.insuedthueringen.de/www/libs/_responsive/js/auth/auth.min.js?x=2026-09-16b-v2512

js insuedthueringen.de collected 2026-10-01 11:35:52 UTC 9,140 bytes, 1 lines download raw bytes

1class AuthManager{constructor(e){this.cmsConfig=e,this.baseUrl="/login";const t=this.cmsConfig._.has("portal.attributes.SingleSignOnCheckInterval")?parseInt(this.cmsConfig._.get("portal.attributes.SingleSignOnCheckInterval"),10):30;this.checkIntervalMs=60*t*1e3,this.signed=!1,this.permission=!1,this.restrictedArea=null,this.reduced=!1,this.paidContent=e._.has("page.paid")&&!0===this.cmsConfig._.get("page.paid"),this.userRegType=e._.get("portal.attributes.userRegType"),this.initializeAuthStatus(),this.signed&&this.paidContent&&!this.permission&&this.isPurchaseReturn()?this.initiateVerifyFlow():(this.initializeActionStatus(),this.signed?(this.initiatePeriodicCheck(),this.paidContent&&this.permission?this.setupContentUnlocking():this.checkNeeded()&&this.checkActive()):this.initiateForceLogin())}static setCookie(e,t,i=null){let o=`${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/`;null!==i&&(o+=`; max-age=${i}`),document.cookie=o}static getCookie(e){const t=`; ${document.cookie}`.split(`; ${e}=`);return 2===t.length?t.pop().split(";").shift():null}static deleteCookie(e){document.cookie=`${e}=; path=/; max-age=0`}static objToQuery(e){let t=new URLSearchParams;for(let i in e)e.hasOwnProperty(i)&&t.append(i,e[i]);return"?"+t.toString()}initializeActionStatus(){const e=AuthManager.getCookie("userAction"),t={};e&&("subscription"==e?(t[e]=this.permission?"successful":"failed",window.preventInterstitial=!0,AuthManager.deleteCookie("verifyRetry")):"login"==e?t[e]=this.signed?"successful":"failed":"logout"==e&&(t[e]=this.signed?"failed":"successful")),AuthManager.deleteCookie("userAction"),ptEventDispatch("userAction",t)}showLoader(e){const t=()=>{let t=document.createElement("div");t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="100vw",t.style.height="100vh",t.style.backgroundColor="rgba(0, 0, 0, 0.5)",t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.zIndex="9999";let i=document.createElement("div");i.style.width="50px",i.style.height="50px",i.style.border="5px solid rgba(255, 255, 255, 0.3)",i.style.borderTop="5px solid #fff",i.style.borderRadius="50%",i.style.animation="spin 1s linear infinite";let o=document.createElement("style");o.innerHTML="@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}",document.head.appendChild(o),t.appendChild(i),document.body.appendChild(t),setTimeout(()=>{document.body.contains(t)&&t.remove()},e)};document.body?t():document.addEventListener("DOMContentLoaded",t)}initiateForceLogin(){if("verify"!=getRequestParameter("action"))return;var e=window.location.href.replace(/([&\?]action=verify*$|action=verify&|[?&]action=verify(?=#))/,"");window.history.replaceState("",document.title,e),AuthManager.setCookie("userAction","subscription");const t=this,i=-1<window.location.href.indexOf("frankenpost.de")||-1<window.location.href.indexOf("np-coburg.de")||-1<window.location.href.indexOf("kurier.de")||-1<window.location.href.indexOf("insuedthueringen.de")?5e3:0;try{this.showLoader(i)}catch(e){console.log("loader",e)}setTimeout(()=>{console.log("exec delayed force login"),t.login()},i)}isPurchaseReturn(){return"subscription"==AuthManager.getCookie("userAction")||"function"==typeof getRequestParameter&&"verify"==getRequestParameter("action")}initiateVerifyFlow(){var e=window.location.href.replace(/([&\?]action=verify*$|action=verify&|[?&]action=verify(?=#))/,"");window.history.replaceState("",document.title,e),AuthManager.setCookie("userAction","subscription"),window.preventInterstitial=!0,AuthManager.deleteCookie("hlp-session"),AuthManager.deleteCookie("hlp-interval");const t=AuthManager.getVerifyAttempts(),i=t>0?6e3:2e4;try{this.showLoader(i)}catch(e){console.log("loader",e)}this.pollPermission(i,2e3,t)}static getVerifyAttempts(){const e=AuthManager.getCookie("verifyRetry"),t=e?parseInt(e,10):0;return isNaN(t)?0:t}retryVerifyLogin(e){AuthManager.setCookie("verifyRetry",String(e+1),120),this.login()}giveUpVerify(){console.log("verify - permission not granted, giving up"),AuthManager.deleteCookie("verifyRetry"),AuthManager.deleteCookie("userAction"),ptEventDispatch("userAction",{subscription:"failed"})}async pollPermission(e,t,i){const o=(new Date).getTime()+e;for(;(new Date).getTime()<o;){let e=null;try{e=await this.checkActive()}catch(e){console.log("verify - check failed",e)}if(void 0===e)return;if(e&&(!0===e.permission||"true"==e.permission))return i>=2?(console.log("verify - permission reported, but cookie not updated"),void this.giveUpVerify()):(console.log("verify - permission granted"),void this.retryVerifyLogin(i));AuthManager.deleteCookie("hlp-interval"),await new Promise(e=>setTimeout(e,t))}if(i<2)return console.log("verify - no permission yet, retry via login"),void this.retryVerifyLogin(i);this.giveUpVerify()}checkNeeded(){return this.signed&&(!AuthManager.getCookie("hlp-session")||!AuthManager.getCookie("hlp-interval"))}initiatePeriodicCheck(){setInterval(async()=>{this.checkNeeded()&&await this.checkActive()},this.checkIntervalMs)}initializeAuthStatus(){const e=AuthManager.getCookie("COOKIEVERIFY");if(e){this.signed=!0;try{const t=decodeURIComponent(e),i=JSON.parse(t.match(/^".*"$/)?t.substring(1,t.length-1):t);this.permission="true"===i.permission||!0===i.permission}catch(e){console.error("Error parsing authentication cookie:",e)}}this.reduced=this.paidContent&&!this.permission}setupContentUnlocking(){if(document.querySelector(".restricted-area"))this.restrictedArea=document.querySelector(".restricted-area"),this.initializeUnlocking();else{new MutationObserver((e,t)=>
1{for(const i of e)"childList"===i.type&&i.addedNodes.forEach(e=>{1===e.nodeType&&e.matches(".restricted-area")&&(this.restrictedArea=e,this.initializeUnlocking(),t.disconnect())})}).observe(document.documentElement,{childList:!0,subtree:!0})}}initializeUnlocking(){this.checkNeeded()?this.checkActive().then(()=>{this.unlockReducedContent()}):this.unlockReducedContent()}async checkActive(){const e=`${this.baseUrl}${AuthManager.objToQuery({"cms.form.field.action":"CHECK_ACTIVE","cms.form.field.login.type":"OAUTH2"})}`,t=await fetch(e),i=await t.json();if(!i.exception||"error.user.not.active"!=i.exception)return AuthManager.setCookie("hlp-session","SESSION"),AuthManager.setCookie("hlp-interval","INTERVAL",this.checkIntervalMs/1e3),i;this.logout()}async login(){AuthManager.getCookie("userAction")||AuthManager.setCookie("userAction","login");const e=this.cmsConfig._.has("page.originCanonical")?this.cmsConfig._.get("page.originCanonical"):window.location.href,t={"cms.form.field.action":"LOGIN","cms.form.field.login.type":"OAUTH2","cms.form.field.redirect":e,"cms.form.field.error.redirect":e},i=`${this.baseUrl}${AuthManager.objToQuery(t)}`,o=await fetch(i),n=await o.json();n.redirect&&(AuthManager.setCookie("hlp-session","SESSION"),AuthManager.setCookie("hlp-interval","INTERVAL",this.checkIntervalMs/1e3),window.location.href=n.redirect)}async editData(){cmsConfig._.has("portal.attributes.SingleSignOnProfileLink")?window.location.href=cmsConfig._.get("portal.attributes.SingleSignOnProfileLink"):console.log("hasso - no profileLink configured")}async logout(){if(AuthManager.getCookie("userAction")||AuthManager.setCookie("userAction","logout"),"KEYCLOAK"==this.userRegType){if(!cmsConfig._.has("portal.attributes.SingleSignOnProfileLink")||!cmsConfig._.has("portal.attributes.SingleSignOnProfileLink"))return;var e=window.location.href.split("?")[0],t="true"===getRequestParameter("inApp"),i=-1<e.indexOf("inApp=true");if(t&&!i)return e+(-1==e.indexOf("?")?"?":"&")+"inApp=true";let o=new URL(cmsConfig._.get("portal.attributes.SingleSignOnProfileLink"));o.searchParams.set("action","logout"),o.searchParams.set("redirect_uri",cmsConfig._.get("page.portalUrl")+"/login?cms.form.field.action=LOGOUT&cms.form.field.login.type=OAUTH2&cms.form.field.redirect="+encodeURIComponent(e)),window.location.href=o}else{const e=this.cmsConfig._.has("page.originCanonical")?this.cmsConfig._.get("page.originCanonical"):window.location.href,t={client_id:this.cmsConfig._.get("portal.attributes.SingleSignOnOAuthClientId"),redirect_uri:this.cmsConfig._.get("page.portalUrl")+"/login?cms.form.field.action=LOGOUT&cms.form.field.login.type=OAUTH2&cms.form.field.redirect="+encodeURIComponent(e),"cms.form.field.error.redirect":encodeURIComponent(e)};window.location.href=this.cmsConfig._.get("portal.attributes.SingleSignOnOAuthLogoutUrl")+AuthManager.objToQuery(t)}}unlockReducedContent(){const e=this.restrictedArea?.getAttribute("mode"),t=this.restrictedArea?.getAttribute("ref"),i=this.restrictedArea?.getAttribute("alias");if("paid"===e){fetch(`${i}._responsive.externally_controlled.freemium.html/id/${t}`,{method:"GET",headers:{"Content-Type":"text/html"},cache:"no-cache"}).then(e=>e.text()).then(e=>{if("UNAUTHORIZED"==e.trim())return AuthManager.deleteCookie("hlp-session"),void window.location.reload();this.restrictedArea.innerHTML=e,this.restrictedArea.setAttribute("mode","free"),ptEventDispatch("displayContent",this.restrictedArea)}).catch(e=>{console.error("Error unlocking content:",e)})}}}const authManager=new AuthManager(cmsConfig);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.