Skip to content

Commit 645d1bf

Browse files
authored
fix: remove leakless true as default (#12)
1 parent 66d10a3 commit 645d1bf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/web/web.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type WebConfig struct {
2525
// timeout value in seconds
2626
timeout int32
2727
headless bool
28+
leakless bool
2829
}
2930

3031
func NewWebConf(datadir string) *WebConfig {
@@ -58,7 +59,7 @@ func New(conf *WebConfig) *Web {
5859
Devtools(false).
5960
Headless(conf.headless).
6061
UserDataDir(conf.datadir).
61-
Leakless(true)
62+
Leakless(conf.leakless)
6263

6364
url := l.MustLaunch()
6465

@@ -76,7 +77,8 @@ func New(conf *WebConfig) *Web {
7677
// GetSamlLogin performs a saml login for a given
7778
func (web *Web) GetSamlLogin(conf credentialexchange.CredentialConfig) (string, error) {
7879

79-
// do not clean up userdata
80+
// close browser even on error
81+
// should cover most cases even with leakless: false
8082
defer web.browser.MustClose()
8183

8284
web.browser.MustPage(conf.ProviderUrl)
@@ -117,6 +119,7 @@ func (web *Web) GetSSOCredentials(conf credentialexchange.CredentialConfig) (str
117119
defer web.browser.MustClose()
118120

119121
web.browser.MustPage(conf.ProviderUrl)
122+
120123
router := web.browser.HijackRequests()
121124
defer router.MustStop()
122125

0 commit comments

Comments
 (0)