Handle HTTP 422 response to OAuth Device flow detection
If HTTP 422 is encountered, assume that OAuth Device Flow is unavailable and fall back to OAuth app authorization flow.
This commit is contained in:
parent
fd31007075
commit
cb4cc72e50
1 changed files with 1 additions and 1 deletions
|
|
@ -69,7 +69,7 @@ func (oa *OAuthFlow) ObtainAccessToken() (accessToken string, err error) {
|
|||
}
|
||||
}
|
||||
|
||||
if resp.StatusCode == 401 || resp.StatusCode == 403 || resp.StatusCode == 404 ||
|
||||
if resp.StatusCode == 401 || resp.StatusCode == 403 || resp.StatusCode == 404 || resp.StatusCode == 422 ||
|
||||
(resp.StatusCode == 400 && values != nil && values.Get("error") == "unauthorized_client") {
|
||||
// OAuth Device Flow is not available; continue with OAuth browser flow with a
|
||||
// local server endpoint as callback target
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue