diff options
author | Minteck <contact@minteck.org> | 2022-07-09 15:22:44 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-07-09 15:22:44 +0200 |
commit | 5abe8cba55965f70e07e1163239bcc9d797c864a (patch) | |
tree | eb29933d2d5420c134f21a941cceb1d361c53b1d /assets/load.js | |
parent | 1a3ff5e4f8bbd4cf35093cdb42d0d93ca635c91e (diff) | |
download | bits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.tar.gz bits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.tar.bz2 bits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.zip |
Bye bye desktop app
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 |