fix: accept HTTP 200 status in OAuth pre-flight check (#1874)

This commit is contained in:
Jeremiah Lowin 2025-09-20 19:23:27 -04:00 committed by GitHub
commit 0ee263a1c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -318,8 +318,8 @@ class OAuth(OAuthClientProvider):
"OAuth client not found - cached credentials may be stale"
)
# For any non-redirect response, something is wrong
if response.status_code not in (302, 303, 307, 308):
# OAuth typically returns redirects, but some providers return 200 with HTML login pages
if response.status_code not in (200, 302, 303, 307, 308):
raise RuntimeError(
f"Unexpected authorization response: {response.status_code}"
)