Made cache optional in get_access_token #441

This commit is contained in:
pearce 2020-02-15 19:23:51 +00:00
parent 1f1e90ed39
commit d71913d087

View File

@ -329,7 +329,7 @@ class SpotifyOAuth(SpotifyAuthBase):
def get_authorization_code(self, response=None):
return self.parse_response_code(response or self.get_auth_response())
def get_access_token(self, code=None, as_dict=True):
def get_access_token(self, code=None, as_dict=True, check_cache=True):
""" Gets the access token for the app given the code
Parameters:
@ -349,6 +349,7 @@ class SpotifyOAuth(SpotifyAuthBase):
stacklevel=2,
)
print("")
if check_cache:
token_info = self.get_cached_token()
if token_info is not None:
if is_token_expired(token_info):