Fix fetching of error description for workos polling

This commit is contained in:
Heitor Sammuel Carvalho
2025-12-18 18:54:30 -03:00
parent dc63bc2319
commit 768c1385b7

View File

@@ -149,7 +149,9 @@ class AuthenticationCommand:
return
if token_data["error"] not in ("authorization_pending", "slow_down"):
raise requests.HTTPError(token_data["error_description"])
raise requests.HTTPError(
token_data.get("error_description") or token_data.get("error")
)
time.sleep(device_code_data["interval"])
attempts += 1