Skip to content

Commit

Permalink
update check for linux running desktop (#1137)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcmmbaga authored Sep 8, 2023
1 parent 30f1c54 commit bb791d5
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions client/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,7 @@ func openURL(cmd *cobra.Command, verificationURIComplete, userCode string) {

// isLinuxRunningDesktop checks if a Linux OS is running desktop environment.
func isLinuxRunningDesktop() bool {
for _, env := range os.Environ() {
values := strings.Split(env, "=")
if len(values) == 2 {
key, value := values[0], values[1]
if key == "XDG_CURRENT_DESKTOP" && value != "" {
return true
}
}
}
return false
return os.Getenv("DESKTOP_SESSION") != "" || os.Getenv("XDG_CURRENT_DESKTOP") != ""
}

// isPKCEFlow determines if the PKCE flow is active or not,
Expand Down

0 comments on commit bb791d5

Please sign in to comment.