Skip to content

Commit 9a5b82b

Browse files
committed
fixed logout and electron dev env
1 parent 138fa34 commit 9a5b82b

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

app/electron/main.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async function createWindow() {
6666
// enable devtools when in development mode
6767
devTools: true,
6868
// crucial security feature - blocks rendering process from having access to node modules
69-
nodeIntegration: false,
69+
nodeIntegration: true,
7070
// web workers will not have access to node
7171
nodeIntegrationInWorker: false,
7272
// disallow experimental feature to allow node.js support in sub-frames (i-frames/child windows)
@@ -76,10 +76,10 @@ async function createWindow() {
7676
// Electron API only available from preload, not loaded page
7777
contextIsolation: true,
7878
// disables remote module. critical for ensuring that rendering process doesn't have access to node functionality
79-
enableRemoteModule: false,
79+
enableRemoteModule: true,
8080
// path of preload script. preload is how the renderer page will have access to electron functionality
8181
preload: path.join(__dirname, 'preload.js'),
82-
nativeWindowOpen: true
82+
nativeWindowOpen: true,
8383
}
8484
});
8585

@@ -391,11 +391,11 @@ ipcMain.on('github', event => {
391391
height: 600,
392392
title: 'Github Oauth',
393393
webPreferences: {
394-
nodeIntegration: false,
394+
nodeIntegration: true,
395395
nodeIntegrationInWorker: false,
396396
nodeIntegrationInSubFrames: false,
397397
contextIsolation: true,
398-
enableRemoteModule: false,
398+
enableRemoteModule: true,
399399
zoomFactor: 1.0
400400
}
401401
});
@@ -470,11 +470,11 @@ ipcMain.on('tutorial', event => {
470470
minWidth: 661,
471471
title: 'Tutorial',
472472
webPreferences: {
473-
nodeIntegration: false,
473+
nodeIntegration: true,
474474
nodeIntegrationInWorker: false,
475475
nodeIntegrationInSubFrames: false,
476476
contextIsolation: true,
477-
enableRemoteModule: false,
477+
enableRemoteModule: true,
478478
zoomFactor: 1.0
479479
}
480480
});

app/electron/menu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ var MenuBuilder = function(mainWindow, appName) {
3939
minWidth: 665,
4040
title: 'Tutorial',
4141
webPreferences: {
42-
nodeIntegration: false,
42+
nodeIntegration: true,
4343
nodeIntegrationInWorker: false,
4444
nodeIntegrationInSubFrames: false,
4545
contextIsolation: true,
46-
enableRemoteModule: false,
46+
enableRemoteModule: true,
4747
zoomFactor: 1.0,
4848
devTools: false
4949
}

app/src/components/right/LoginButton.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ export default function LoginButton() {
2121
// };
2222

2323
const handleLogout = () => {
24-
document.cookie = "SSID=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"
24+
// document.cookie = "ssid=; expires=Thu, 01 Jan 1970 00:00:00 UTC;"
25+
// console.log(document.cookie)
26+
//localStorage.clear();
27+
window.localStorage.clear();
28+
//window.api.delCookie();
2529
//const navigate = useNavigate();
2630
//navigate('/');
2731
window.location.href = 'http://localhost:8080/#/login';
32+
window.api.delCookie();
2833
// window.location.reload();
2934
}
3035
if (state.isLoggedIn) {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
"scripts": {
5959
"postinstall": "set ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true electron-builder install-app-deps",
6060
"dev-server": "cross-env NODE_ENV=development webpack-dev-server --config ./webpack.development.js",
61-
"dev": "concurrently --success first \"cross-env NODE_ENV=development webpack-dev-server --config ./webpack.development.js\" \"cross-env NODE_ENV=development electron .\" \"npm run server\" -k",
61+
"dev": "concurrently -k \"cross-env NODE_ENV=development webpack-dev-server --config ./webpack.development.js\" \"cross-env NODE_ENV=development nodemon server/server.js --open\"",
62+
"electron-dev": "cross-env NODE_ENV=development electron .",
6263
"prod-build": "cross-env NODE_ENV=production npx webpack --mode=production --config ./webpack.production.js",
6364
"prod": "npm run prod-build && electron . --no-sandbox",
6465
"pack": "electron-builder --dir",

0 commit comments

Comments
 (0)