Add authentication
This commit is contained in:
11 files changed
+207
-33
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user