// Redirect the user to the login page if session storage key is not set if (!globalThis.dlink.loggedin) { const getRandomString = (length = 16) => { const CHARSET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; let string = ""; for (let i = 0; i < length; i++) string += CHARSET[Math.floor(Math.random() * CHARSET.length)]; return string; }; const url = new URL(window.location); // Set some legit looking overcomplicated search parameters url.searchParams.set("mydl_sid", getRandomString()); // This is our fake "user is logged in" Storage API key url.searchParams.set("action", "login"); url.searchParams.set(`mydl_${getRandomString(3)}`, "dashboard"); url.searchParams.set(`mydl_asas_${getRandomString(4)}_${getRandomString(8)}`, "login_cgi"); url.pathname = globalThis.dlink.LOGIN_PAGE; setTimeout(() => { new VV().navigate(url); }, 2500); } else { VV.shell.VV.loading = true; setTimeout(() => { new VV().navigate("/dashboard"); }, 1000); }