  })
        .catch((error) => {
            console.warn("authentik/policies/buffer: Error checking authentication.", error);
            return false;
        })
}

const offset = 20;

let timeoutID = -1;
let timeout = 100;
let attempts = 0;

async function main() {
    window.clearTimeout(timeoutID);

    attempts += 1;

    redirecting = await checkAuth();

    console.debug(`authentik/policies/buffer: Waiting ${timeout}ms...`);

    timeoutID = window.setTimeout(main, timeout);

    timeout += offset *