diff options
Diffstat (limited to 'assets/load.js')
-rw-r--r-- | assets/load.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/assets/load.js b/assets/load.js new file mode 100644 index 0000000..fc3f464 --- /dev/null +++ b/assets/load.js @@ -0,0 +1,23 @@ +window.onload = async () => { + if (!isNodeJS) { + document.getElementById("mobile-css").removeAttribute("disabled"); + } + + setTimeout(async () => { + loginStatus = JSON.parse(await (await window.fetch("https://money-v1.equestria.dev/Authentication/Test/")).text()).status; + if (loginStatus === 1) { + if (isNodeJS) { + console.info("Starting authentication procedure (Electron)"); + const { ipcRenderer } = require('electron'); + ipcRenderer.send("login"); + } else { + console.info("Starting authentication procedure (Mobile)"); + location.href = "https://money-v1.equestria.dev/Authentication/Mobile/" + } + } else { + console.info("Authenticated successfully"); + + await refresh(); + } + }, 1000) +}
\ No newline at end of file |