Skip to content

Commit

Permalink
options
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Dec 23, 2023
1 parent 9c88b58 commit 930ac1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion auth/browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type browserOpts struct {
browser browser.Browser
flow BrowserAuthUI
loginTimeout time.Duration
verbose bool
}

type BrowserAuthUI interface {
Expand Down Expand Up @@ -61,7 +62,7 @@ func NewBrowserAuth(ctx context.Context, opts ...Option) (BrowserAuth, error) {
br.opts.workspace = wsp
}

auther, err := browser.New(br.opts.workspace, browser.OptBrowser(br.opts.browser), browser.OptTimeout(br.opts.loginTimeout))
auther, err := browser.New(br.opts.workspace, browser.OptBrowser(br.opts.browser), browser.OptTimeout(br.opts.loginTimeout), browser.OptVerbose(br.opts.verbose))
if err != nil {
return br, err
}
Expand Down
6 changes: 6 additions & 0 deletions auth/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ func BrowserWithTimeout(d time.Duration) Option {
o.browserOpts.loginTimeout = d
}
}

func BrowserWithVerbose(b bool) Option {
return func(o *options) {
o.browserOpts.verbose = b
}
}

0 comments on commit 930ac1e

Please sign in to comment.