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.
Since
OAuth
2 inheritsSender
and calls its__init__
, if the user doesn't have theGENIUS_ACCESS_TOKEN
env var present, they'll get anInvalidTokenError
. This temporary fix which also worked forPublicAPI
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 currentpublic_api_contstructor
doesn't work if user decides to subclass Genius: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.