Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix authentication cloudflare issue #6

Merged
merged 6 commits into from
Oct 15, 2023

Conversation

sehnryr
Copy link
Contributor

@sehnryr sehnryr commented Oct 14, 2023

Loading homepage may sometimes land on cloudflare making getting the csrf token impossible. This workaround uses header authentication instead of cookies.

Added support for item subtypes for Order types.

Also refactored code (see commits)

bs4 was only used to parse an html page to get a CSRF token for authentication, which can be replaced with simpler splits
Removed typing's `Optional` from some function's arguments since it was clearly an optional with a default value, and also caused PyRight to scream as you cannot call members of an Optional[Any] the same as Any.
As Pyright cannot know which type is returned from `get_orders`, overloading it with distinct return types fixes the issue
Loading homepage sometimes lands on cloudflare making authentication fail. Switching to header authentication.

renaming `get_csrf_and_jwt` to `get_jwt_token`
@leonardodalinky
Copy link
Owner

The formatter check fails... Could you check Makefile for a quick fix? isort and black is needed before pushed. I think I should refactor and elaborate more on this later. Sorry!

format using `make black` and `make isort` commands
@leonardodalinky leonardodalinky merged commit ec35f45 into leonardodalinky:main Oct 15, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants