mirror of
https://github.com/platformio/platformio-core.git
synced 2025-08-01 02:54:25 +02:00
Remove account state item if refreshing token failed (#3487)
This commit is contained in:
@@ -206,9 +206,12 @@ class AccountClient(object):
|
|||||||
self.api_base_url + "/v1/login",
|
self.api_base_url + "/v1/login",
|
||||||
headers={"Authorization": "Bearer %s" % auth.get("refresh_token")},
|
headers={"Authorization": "Bearer %s" % auth.get("refresh_token")},
|
||||||
)
|
)
|
||||||
result = self.raise_error_from_response(response)
|
try:
|
||||||
app.set_state_item("account", result)
|
result = self.raise_error_from_response(response)
|
||||||
return result.get("auth").get("access_token")
|
app.set_state_item("account", result)
|
||||||
|
return result.get("auth").get("access_token")
|
||||||
|
except exception.AccountError:
|
||||||
|
app.delete_state_item("account")
|
||||||
raise exception.AccountNotAuthenticated()
|
raise exception.AccountNotAuthenticated()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Reference in New Issue
Block a user