From 36e28a245cb3ab14c20cc185356e93ce5fab3e03 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 23 Nov 2021 13:18:42 +0100 Subject: [PATCH] Fixed typing issues Contributes to: CURA-8539 --- cura/OAuth2/AuthorizationService.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cura/OAuth2/AuthorizationService.py b/cura/OAuth2/AuthorizationService.py index 38ecd1e823..0343af68a8 100644 --- a/cura/OAuth2/AuthorizationService.py +++ b/cura/OAuth2/AuthorizationService.py @@ -3,7 +3,7 @@ import json from datetime import datetime, timedelta -from typing import Callable, Dict, Optional, TYPE_CHECKING +from typing import Callable, Dict, Optional, TYPE_CHECKING, Union from urllib.parse import urlencode, quote_plus from PyQt5.QtCore import QUrl @@ -15,7 +15,7 @@ from UM.Signal import Signal from UM.i18n import i18nCatalog from cura.OAuth2.AuthorizationHelpers import AuthorizationHelpers, TOKEN_TIMESTAMP_FORMAT from cura.OAuth2.LocalAuthorizationServer import LocalAuthorizationServer -from cura.OAuth2.Models import AuthenticationResponse +from cura.OAuth2.Models import AuthenticationResponse, BaseModel i18n_catalog = i18nCatalog("cura") @@ -117,7 +117,7 @@ class AuthorizationService: callback(user_profile) return # The JWT was expired or invalid and we should request a new one. - if self._auth_data.refresh_token is None: + if self._auth_data is None or self._auth_data.refresh_token is None: Logger.warning("There was no refresh token in the auth data.") callback(None) return