Skip to content

Commit be70a04

Browse files
authored
fix: correct error fetching for workos login polling (#4124)
1 parent 0c359f4 commit be70a04

File tree

1 file changed

+3
-1
lines changed
  • lib/crewai/src/crewai/cli/authentication

1 file changed

+3
-1
lines changed

lib/crewai/src/crewai/cli/authentication/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ def _poll_for_token(self, device_code_data: dict[str, Any]) -> None:
149149
return
150150

151151
if token_data["error"] not in ("authorization_pending", "slow_down"):
152-
raise requests.HTTPError(token_data["error_description"])
152+
raise requests.HTTPError(
153+
token_data.get("error_description") or token_data.get("error")
154+
)
153155

154156
time.sleep(device_code_data["interval"])
155157
attempts += 1

0 commit comments

Comments
 (0)