Skip to content

Commit d2edef7

Browse files
committed
feat: add support for BROWSER environment variable in openBrowser function
1 parent 467b18d commit d2edef7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

core/dbio/api/auth.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,14 @@ func generateRandomState() string {
672672
return base64.URLEncoding.EncodeToString(b)
673673
}
674674

675-
// openBrowser opens the default browser to the given URL (unchanged from original).
675+
// openBrowser opens the default browser to the given URL.
676+
// If the BROWSER environment variable is set, it is used as the browser command.
676677
func (a *AuthenticatorOAuth2) openBrowser(url string) error {
678+
// Respect BROWSER env var for session-level browser override
679+
if browserEnv := os.Getenv("BROWSER"); browserEnv != "" {
680+
return exec.Command(browserEnv, url).Start()
681+
}
682+
677683
var cmd string
678684
var args []string
679685

0 commit comments

Comments
 (0)