loginTokenName

This commit is contained in:
monoid 2021-01-10 18:02:26 +09:00
parent 8219606297
commit 0e2698569a

4
app.ts
View File

@ -1,7 +1,7 @@
import { app, BrowserWindow, session } from "electron"; import { app, BrowserWindow, session } from "electron";
import { get_setting } from "./src/setting"; import { get_setting } from "./src/setting";
import { create_server, start_server } from "./src/server"; import { create_server, start_server } from "./src/server";
import { getAdminCookieValue } from "./src/login"; import { getAdminCookieValue, loginTokenName } from "./src/login";
const get_loading_html = (content?:string)=> `<!DOCTYPE html> const get_loading_html = (content?:string)=> `<!DOCTYPE html>
<html lang="ko"><head> <html lang="ko"><head>
@ -49,7 +49,7 @@ if (!setting.cli) {
await window.loadURL(`data:text/html;base64,`+Buffer.from(get_loading_html()).toString('base64')); await window.loadURL(`data:text/html;base64,`+Buffer.from(get_loading_html()).toString('base64'));
await session.defaultSession.cookies.set({ await session.defaultSession.cookies.set({
url:`http://localhost:${setting.port}`, url:`http://localhost:${setting.port}`,
name:"access_token", name:loginTokenName,
value:getAdminCookieValue(), value:getAdminCookieValue(),
httpOnly: true, httpOnly: true,
secure: false, secure: false,