Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
feat: clear sensitive data on sign out
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny243 committed Apr 14, 2021
1 parent db3fbd9 commit a7e1368
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/javascripts/main/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { checkForUpdate, setupUpdates } from './updateManager';
import { isTesting, lowercaseDriveLetter } from './utils';
import { initializeZoomManager } from './zoomManager';
import { Paths } from './paths';
import { clearSensitiveDirectories } from 'electron-clear-data';

const WINDOW_DEFAULT_WIDTH = 1100;
const WINDOW_DEFAULT_HEIGHT = 800;
Expand Down Expand Up @@ -94,8 +95,7 @@ export async function createWindowState({

window.webContents.on('ipc-message', async (_event, message) => {
if (message === IpcMessages.SigningOut) {
await window.webContents.session.clearStorageData();
window.webContents.session.flushStorageData();
clearSensitiveDirectories();
}
});

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"dotenv": "^8.2.0",
"electron": "^9.4.0",
"electron-builder": "^22.9.1",
"electron-clear-data": "^1.0.3",
"electron-notarize": "^1.0.0",
"eslint": "^7.20.0",
"eslint-config-prettier": "^6.11.0",
Expand Down
17 changes: 6 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2507,6 +2507,11 @@ electron-builder@^22.9.1:
update-notifier "^4.1.1"
yargs "^16.0.3"

electron-clear-data@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/electron-clear-data/-/electron-clear-data-1.0.3.tgz#589b1b3daa9e77dbd321b5ba17b53cc6a86e5033"
integrity sha512-QSownRD/JOqN7c4ypD0+dEtz44hwNqCrsepqcyTciA8w4DJ6fk81JoFOdJbqngOHS/wqXpgXJU09J60s37138A==

electron-log@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-4.3.1.tgz#1405fef9d4e6964a5fdb8790a69163aa237ffe91"
Expand Down Expand Up @@ -3081,7 +3086,7 @@ fs-extra@^8.1.0:
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-extra@^9.0.1:
fs-extra@^9.0.1, fs-extra@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz"
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
Expand All @@ -3091,16 +3096,6 @@ fs-extra@^9.0.1:
jsonfile "^6.0.1"
universalify "^2.0.0"

fs-extra@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
dependencies:
at-least-node "^1.0.0"
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"

fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz"
Expand Down

0 comments on commit a7e1368

Please sign in to comment.