Merge pull request #2900 from sevki/no-token-err-fix
fix no error returned in fetchTokenWithOAuth
This commit is contained in:
commit
84f47e7bb3
1 changed files with 4 additions and 0 deletions
|
@ -366,6 +366,10 @@ func (th *tokenHandler) fetchTokenWithOAuth(realm *url.URL, refreshToken, servic
|
||||||
return "", time.Time{}, fmt.Errorf("unable to decode token response: %s", err)
|
return "", time.Time{}, fmt.Errorf("unable to decode token response: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if tr.AccessToken == "" {
|
||||||
|
return "", time.Time{}, ErrNoToken
|
||||||
|
}
|
||||||
|
|
||||||
if tr.RefreshToken != "" && tr.RefreshToken != refreshToken {
|
if tr.RefreshToken != "" && tr.RefreshToken != refreshToken {
|
||||||
th.creds.SetRefreshToken(realm, service, tr.RefreshToken)
|
th.creds.SetRefreshToken(realm, service, tr.RefreshToken)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue