X Tutup
Skip to content

Commit a6776d0

Browse files
committed
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.
1 parent 60eebd2 commit a6776d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

auth/oauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (oa *OAuthFlow) ObtainAccessToken() (accessToken string, err error) {
5757
}
5858
defer resp.Body.Close()
5959

60-
if resp.StatusCode == 404 {
60+
if resp.StatusCode == 401 || resp.StatusCode == 403 || resp.StatusCode == 404 {
6161
// OAuth Device Flow is not available; continue with OAuth browser flow with a
6262
// local server endpoint as callback target
6363
return oa.localServerFlow()

0 commit comments

Comments
 (0)
X Tutup