Skip to content

Commit

Permalink
rpcclient: Try user+pass auth before cookie auth
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed May 25, 2020
1 parent 6194953 commit deb09c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rpcclient/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -1171,12 +1171,12 @@ type ConnConfig struct {
// path is configured; if not, it will be the user-configured username and
// passphrase.
func (config *ConnConfig) getAuth() (username, passphrase string, err error) {
// If cookie auth isn't in use, just use the supplied
// username/passphrase.
if config.CookiePath == "" {
// Try username+passphrase auth first.
if config.Pass != "" {
return config.User, config.Pass, nil
}

// If no username or passphrase is set, try cookie auth.
return config.retrieveCookie()
}

Expand Down

0 comments on commit deb09c7

Please sign in to comment.