mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 08:39:01 +08:00
Expand the logging for the auth data a bit more
We're getting some reports that people are suddenly logged out. The working theory is that they are mixing staging & production builds. This logging should tell us enough to find out if that is the case!
This commit is contained in:
parent
2991881145
commit
f85cad37cf
@ -58,7 +58,7 @@ class AuthorizationHelpers:
|
|||||||
:return: An AuthenticationResponse object.
|
:return: An AuthenticationResponse object.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
Logger.log("d", "Refreshing the access token.")
|
Logger.log("d", "Refreshing the access token for [%s]", self._settings.OAUTH_SERVER_URL)
|
||||||
data = {
|
data = {
|
||||||
"client_id": self._settings.CLIENT_ID if self._settings.CLIENT_ID is not None else "",
|
"client_id": self._settings.CLIENT_ID if self._settings.CLIENT_ID is not None else "",
|
||||||
"redirect_uri": self._settings.CALLBACK_URL if self._settings.CALLBACK_URL is not None else "",
|
"redirect_uri": self._settings.CALLBACK_URL if self._settings.CALLBACK_URL is not None else "",
|
||||||
@ -110,7 +110,9 @@ class AuthorizationHelpers:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
token_request = requests.get("{}/check-token".format(self._settings.OAUTH_SERVER_URL), headers = {
|
check_token_url = "{}/check-token".format(self._settings.OAUTH_SERVER_URL)
|
||||||
|
Logger.log("d", "Checking the access token for [%s]", check_token_url)
|
||||||
|
token_request = requests.get(check_token_url, headers = {
|
||||||
"Authorization": "Bearer {}".format(access_token)
|
"Authorization": "Bearer {}".format(access_token)
|
||||||
})
|
})
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
|
@ -247,7 +247,7 @@ class AuthorizationService:
|
|||||||
def _storeAuthData(self, auth_data: Optional[AuthenticationResponse] = None) -> None:
|
def _storeAuthData(self, auth_data: Optional[AuthenticationResponse] = None) -> None:
|
||||||
"""Store authentication data in preferences."""
|
"""Store authentication data in preferences."""
|
||||||
|
|
||||||
Logger.log("d", "Attempting to store the auth data")
|
Logger.log("d", "Attempting to store the auth data for [%s]", self._settings.OAUTH_SERVER_URL)
|
||||||
if self._preferences is None:
|
if self._preferences is None:
|
||||||
Logger.log("e", "Unable to save authentication data, since no preference has been set!")
|
Logger.log("e", "Unable to save authentication data, since no preference has been set!")
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user