mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
Merge pull request #442 from CharleyPearce/master
Made cache optional in get_access_token #441
This commit is contained in:
commit
dcc53b983e
@ -329,7 +329,7 @@ class SpotifyOAuth(SpotifyAuthBase):
|
|||||||
def get_authorization_code(self, response=None):
|
def get_authorization_code(self, response=None):
|
||||||
return self.parse_response_code(response or self.get_auth_response())
|
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
|
""" Gets the access token for the app given the code
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
@ -349,6 +349,7 @@ class SpotifyOAuth(SpotifyAuthBase):
|
|||||||
stacklevel=2,
|
stacklevel=2,
|
||||||
)
|
)
|
||||||
print("")
|
print("")
|
||||||
|
if check_cache:
|
||||||
token_info = self.get_cached_token()
|
token_info = self.get_cached_token()
|
||||||
if token_info is not None:
|
if token_info is not None:
|
||||||
if is_token_expired(token_info):
|
if is_token_expired(token_info):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user