Skip to content

Commit

Permalink
clear session after getting token
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Sep 7, 2020
1 parent cba1032 commit 863ca11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ function onAppReady () {
gotToken ? startApp() : quitApp()
}
})
await window.webContents.session.clearStorageData()
window.webContents.on('will-redirect', async (event, url) => {
if (url.startsWith('http://localhost')) {
event.preventDefault()
const parsedHash = new URLSearchParams(url.split('#', 2)[1])
const token = parsedHash.get('access_token')
await settings.set('token', token)
await window.webContents.session.clearStorageData()
gotToken = true
window.close()
}
Expand Down

0 comments on commit 863ca11

Please sign in to comment.