File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -291,5 +291,7 @@ def _refresh(self, access_token):
291291 """
292292 # pylint:disable=unused-argument
293293 if self ._user_id is None :
294- return self .authenticate_instance ()
295- return self .authenticate_user ()
294+ new_access_token = self .authenticate_instance ()
295+ else :
296+ new_access_token = self .authenticate_user ()
297+ return new_access_token , None
Original file line number Diff line number Diff line change @@ -203,12 +203,11 @@ def refresh(self, access_token_to_refresh):
203203 # The lock here is for handling that case that multiple requests fail, due to access token expired, at the
204204 # same time to avoid multiple session renewals.
205205 if (access_token is None ) or (access_token_to_refresh == access_token ):
206- # If the active access token is the same as the token needs to
206+ # If the active access token is the same as the token that needs to
207207 # be refreshed, or if we don't currently have any active access
208208 # token, we make the request to refresh the token.
209- return self ._refresh (access_token_to_refresh )
210-
211- # If the active access token (self._access_token) is not the same as the token needs to be refreshed,
209+ access_token , refresh_token = self ._refresh (access_token_to_refresh )
210+ # Else, if the active access token (self._access_token) is not the same as the token needs to be refreshed,
212211 # it means the expired token has already been refreshed. Simply return the current active tokens.
213212 return access_token , refresh_token
214213
You can’t perform that action at this time.
0 commit comments