From 5abe8cba55965f70e07e1163239bcc9d797c864a Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 9 Jul 2022 15:22:44 +0200 Subject: Bye bye desktop app --- assets/load.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 assets/load.js (limited to 'assets/load.js') 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 -- cgit