PageSourceSearch

https://stiften.dk/assets/1790063100/kodus/sso-client/generated/js/redirect.js

js stiften.dk collected 2026-09-24 17:21:10 UTC 1,367 bytes, 27 lines download raw bytes

1const shouldReinstateAnonymousSession = (authenticated) => document.cookie.includes('ssoAuthenticated=true') && !authenticated;
2const createReinstateAnonymousSessionUrl = (redirectUrl, reinstateAnonymousSessionPath) => {
3    const url = new URL(redirectUrl);
4    return url.origin + reinstateAnonymousSessionPath + '?return_url=' + encodeURIComponent(redirectUrl);
5};
6const initSsoClientRedirect = (autoLoginUrl, reinstateAnonymousSessionPath) => {
7    return (authenticated, redirectUrl, delayInSeconds = 60) => {
8        const lastRedirectStored = sessionStorage.getItem('lastSsoClientRedirect');
9        const lastRedirect = lastRedirectStored ? Number(lastRedirectStored) : null;
10        const timeNow = Date.now();
11        if (shouldReinstateAnonymousSession(authenticated)) {
12            window.location.replace(createReinstateAnonymousSessionUrl(redirectUrl, reinstateAnonymousSessionPath));
13            return false;
14        }
15        if (lastRedirect !== null && timeNow < lastRedirect + delayInSeconds * 1000) {
16            return true;
17        }
18        if (!authenticated) {
19            sessionStorage.setItem('lastSsoClientRedirect', timeNow.toString(10));
20            window.location.assign(autoLoginUrl + '?return_url=' + encodeURIComponent(redirectUrl));
21            return false;
22        }
23        else {
24            return true;
25        }
26    };
27};

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.