Repository navigation
Send login headers on v1 web login requests (#413) - #414
Merged
Merged
Conversation
LoicSERRE
added a commit
to LoicSERRE/finalibaba-selfhosted
that referenced
this pull request
Nov 2, 2026
…150) Trade Republic now rejects a v1 web login without X-TR-Device-Info (400 MISSING_REQUIRED_HEADER, pytr-org/pytr#413). pytr only sends its login headers on v2; new_tr_api adds them to the session until pytr-org/pytr#414 lands.
RealCLanger
approved these changes
Nov 2, 2026
RealCLanger
left a comment
Collaborator
There was a problem hiding this comment.
Great. I already feared that TR dropped the V1 login API. Thanks for the contribution.
This was referenced Nov 2, 2026
LoicSERRE
added a commit
to LoicSERRE/finalibaba-selfhosted
that referenced
this pull request
Nov 3, 2026
pytr now sends its login headers on v1 too (#147), so the local workaround goes. The v1 header test now runs against pytr itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Trade Republic started enforcing the
X-TR-Device-Infoheader check onPOST /api/v1/auth/web/loginas well: requests without_login_headers()now receive:{"errors": [{"errorCode": "MISSING_REQUIRED_HEADER", "errorMessage": null, "meta": null}]}with HTTP status
400 Bad Request(even when a validaws-waf-tokencookie obtained via Playwright is present).Previously,
initiate_weblogin(),resend_weblogin(), andcomplete_weblogin()only attachedself._login_headers()whenself._use_v2_loginwas enabled. Sendingself._login_headers()on the v1 web login requests as well satisfies the header check and restores the default v1 login flow.Fixes #413
Testing
https://api.traderepublic.com/api/v1/auth/web/loginwith a Playwright WAF token that omittingX-TR-Device-Inforeturns400 MISSING_REQUIRED_HEADERwhereas including_login_headers()passes header validation.test_every_v1_login_call_sends_the_required_headersintests/test_api_urls.py.pytest,ruff check,ruff format --check, andmypy .all pass.