add login mechanic

This commit is contained in:
2024-01-11 01:00:43 +01:00
parent 6790fe5ef6
commit 05b9ddd5a1
7 changed files with 138 additions and 67 deletions

View File

@@ -1,4 +1,5 @@
const { Titlebar, TitlebarColor } = require("custom-electron-titlebar");
const { ipcRenderer } = require("electron");
window.addEventListener("DOMContentLoaded", () => {
const titlebar = new Titlebar({
@@ -8,6 +9,12 @@ window.addEventListener("DOMContentLoaded", () => {
enableMnemonics: false,
maximizable: false,
});
//titlebar.updateTitle(`${appInfo.appName} ${appInfo.appVersion}`);
});
window.addEventListener("login-attempt", async (e) => {
const loginResult = await ipcRenderer.invoke("ezpplauncher:login", {
username: e.detail.username,
password: e.detail.password,
});
window.dispatchEvent(new CustomEvent("login-result", { detail: loginResult }));
})