Skip to content

Commit fa6f2b6

Browse files
committed
Use browser headers on login POST and MFA verify
Cloudflare detects the User-Agent switch between the sign-in page (browser UA) and the login POST (GCM-iOS UA) and returns 429. Use SSO_PAGE_HEADERS on both API calls to stay consistent.
1 parent 9760c41 commit fa6f2b6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/garth/sso.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def login(
118118
"sso",
119119
"/mobile/api/login",
120120
params=login_params,
121+
headers=SSO_PAGE_HEADERS,
121122
json={
122123
"username": email,
123124
"password": password,
@@ -217,6 +218,7 @@ def handle_mfa(
217218
"sso",
218219
"/mobile/api/mfa/verifyCode",
219220
params=login_params,
221+
headers=SSO_PAGE_HEADERS,
220222
json={
221223
"mfaMethod": mfa_method,
222224
"mfaVerificationCode": mfa_code,

0 commit comments

Comments
 (0)