Skip to content

Commit 7fd6982

Browse files
author
László Vaskó
committed
browser: more failsafe cookie persistence
1 parent b5ccc6e commit 7fd6982

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
## vNext
44

5+
- More failsafe method to reuse existing authentication sessions, so that
6+
entering password/MFA token may not be needed at all. Persisting HTTP cookies
7+
were prone to a race condition which is hopefully mitigated by this change.
8+
59
## v0.7.2
10+
611
- Update dependencies `keyring` and `importlib-metadata`
712
([pull/52](https://github.com/vlaci/openconnect-sso/pull/52))
813

openconnect_sso/browser/webengine_process.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ def on_sigterm(signum, frame):
129129
# See: https://github.com/qutebrowser/qutebrowser/commit/8d55d093f29008b268569cdec28b700a8c42d761
130130
cookie = QNetworkCookie()
131131
QWebEngineProfile.defaultProfile().cookieStore().deleteCookie(cookie)
132-
QApplication.quit()
132+
133+
# Give some time to actually save cookies
134+
exit_timer = QTimer(app)
135+
exit_timer.timeout.connect(QApplication.quit)
136+
exit_timer.start(1000) # ms
133137

134138

135139
class WebBrowser(QWebEngineView):

0 commit comments

Comments
 (0)