Also call processing functions for error callbacks

Otherwise the appropriate callbacks might not get called.

Contributes to issue CURA-8539.
This commit is contained in:
Ghostkeeper 2021-11-22 14:44:52 +01:00
parent e8f9e92f02
commit 8ea8cc752f
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
2 changed files with 3 additions and 2 deletions

View file

@ -73,7 +73,8 @@ class AuthorizationHelpers:
self._token_url, self._token_url,
data = urllib.parse.urlencode(data).encode("UTF-8"), data = urllib.parse.urlencode(data).encode("UTF-8"),
headers_dict = headers, headers_dict = headers,
callback = lambda response: self.parseTokenResponse(response, callback) callback = lambda response: self.parseTokenResponse(response, callback),
error_callback = lambda response: self.parseTokenResponse(response, callback)
) )
def parseTokenResponse(self, token_response: QNetworkReply, callback: Callable[[AuthenticationResponse], None]) -> None: def parseTokenResponse(self, token_response: QNetworkReply, callback: Callable[[AuthenticationResponse], None]) -> None:

View file

@ -134,7 +134,7 @@ class AuthorizationService:
self._auth_helpers.getAccessTokenUsingRefreshToken(self._auth_data.refresh_token, process_auth_data) self._auth_helpers.getAccessTokenUsingRefreshToken(self._auth_data.refresh_token, process_auth_data)
self._auth_helpers.checkToken(self._auth_data.access_token, check_user_profile, lambda: callback(None)) self._auth_helpers.checkToken(self._auth_data.access_token, check_user_profile, lambda: check_user_profile(None))
def getAccessToken(self) -> Optional[str]: def getAccessToken(self) -> Optional[str]:
"""Get the access token as provided by the response data.""" """Get the access token as provided by the response data."""