rpcclient: Try user+pass auth before cookie auth
This commit is contained in:
parent
915788b8e6
commit
e6f163e61e
1 changed files with 3 additions and 3 deletions
|
@ -1171,12 +1171,12 @@ type ConnConfig struct {
|
||||||
// path is configured; if not, it will be the user-configured username and
|
// path is configured; if not, it will be the user-configured username and
|
||||||
// passphrase.
|
// passphrase.
|
||||||
func (config *ConnConfig) getAuth() (username, passphrase string, err error) {
|
func (config *ConnConfig) getAuth() (username, passphrase string, err error) {
|
||||||
// If cookie auth isn't in use, just use the supplied
|
// Try username+passphrase auth first.
|
||||||
// username/passphrase.
|
if config.Pass != "" {
|
||||||
if config.CookiePath == "" {
|
|
||||||
return config.User, config.Pass, nil
|
return config.User, config.Pass, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If no username or passphrase is set, try cookie auth.
|
||||||
return config.retrieveCookie()
|
return config.retrieveCookie()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue