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 initiating OAuth2 InvalidTokenError #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

allerter
Copy link
Collaborator

@allerter allerter commented Feb 16, 2021

Since OAuth2 inherits Sender and calls its __init__, if the user doesn't have the GENIUS_ACCESS_TOKEN env var present, they'll get an InvalidTokenError. This temporary fix which also worked for PublicAPI will work for now until we refactor the classes and make the sender an attribute instead of inheriting it.

Side note: we should definitely switch to using self.sender, because the current public_api_contstructor doesn't work if user decides to subclass Genius:

public_api_constructor = False if self.__class__.__name__ == 'Genius' else True

The variable's value will be True if for example the user's subclass is called MyGenius. This will result in a missing authorization header and a 401 error for all calls that need an access token.

@allerter allerter added the bug label Feb 16, 2021
@allerter allerter requested review from johnwmillr and removed request for johnwmillr March 26, 2021 06:43
@allerter allerter added this to the 3.0.1 milestone Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant