File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ def _refresh(self, access_token):
193193 """
194194 # pylint:disable=unused-argument
195195 if self ._user_id is None :
196- return self .authenticate_instance ()
196+ new_access_token = self .authenticate_instance ()
197197 else :
198- return self ._auth_with_jwt (self ._user_id , 'user' )
198+ new_access_token = self ._auth_with_jwt (self ._user_id , 'user' )
199+ return new_access_token , None
Original file line number Diff line number Diff line change @@ -203,14 +203,13 @@ 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- else :
211- # If the active access token (self._access_token) is not the same as the token needs to be refreshed,
212- # it means the expired token has already been refreshed. Simply return the current active tokens.
213- return access_token , refresh_token
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,
211+ # it means the expired token has already been refreshed. Simply return the current active tokens.
212+ return access_token , refresh_token
214213
215214 @staticmethod
216215 def _get_state_csrf_token ():
You can’t perform that action at this time.
0 commit comments