Allow more HTTP 40x codes to trigger fallback to old OAuth flow
I want to avoid falling back to the old OAuth flow for just any HTTP 4xx/5xx because other statuses should be allowed to surface a problem with a request or the server.
This commit is contained in:
parent
60eebd2896
commit
a6776d0ba2
1 changed files with 1 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ func (oa *OAuthFlow) ObtainAccessToken() (accessToken string, err error) {
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode == 404 {
|
||||
if resp.StatusCode == 401 || resp.StatusCode == 403 || resp.StatusCode == 404 {
|
||||
// OAuth Device Flow is not available; continue with OAuth browser flow with a
|
||||
// local server endpoint as callback target
|
||||
return oa.localServerFlow()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue