Add authentication

This commit is contained in:
Prayag committed 2022-03-09 13:25:16 +05:30
1 parent 6eb80e2498
commit 7f447538e9
11 files changed
+207 -33

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
const { app, BrowserWindow, ipcMain } = require('electron');
const got = require('got');
const emitter = require('../common/emitter');
const config = require('../config');
const { Jellyfin } = require('@thornbill/jellyfin-sdk');
class HomePage {
constructor() {
this.createWindow();
this.logoutRequest();
}
createWindow() {
this.window = new BrowserWindow({
width: 800,
height: 700,
center: true,
resizable: true,
maximizable: true,
show: false,
webPreferences: {
nodeIntegration: true
}
});
this.window.loadFile("./src/render/html/home.html");
this.window.webContents.openDevTools();
}
logoutRequest() {
ipcMain.on('logout-user', () => {
emitter.emit('logout-user');
});
}
showHome() {
this.window.show();
}
hideHome() {
this.window.hide();
}
closeHome() {
this.window.close();
}
}
module.exports = HomePage;