Add more logging for refresh process // renew refresh token if returned from api

This commit is contained in:
linus
2025-08-23 11:25:38 +02:00
parent 1a2f35f1b5
commit 4673f14a1c
2 changed files with 10 additions and 2 deletions
+7
View File
@@ -1,3 +1,10 @@
## v1.12.2
### 🚀 Features:
- Add more logging for refresh process
- Update refresh token, if volvo API returns a new one
## v1.12.1
### 🐛 Bug Fixes:
+3 -2
View File
@@ -203,11 +203,12 @@ def refresh_auth():
f = open(token_path)
try:
data = json.load(f)
refresh_token = data["refresh_token"]
refresh_data["refresh_token"] = data["refresh_token"]
except ValueError:
raise Exception("Cannot refresh token!")
else:
logging.info("New refresh token found, updating!")
refresh_data["refresh_token"] = refresh_token
util.save_to_json(refresh_data, token_path)
session.headers.update({"authorization": "Bearer " + refresh_data["access_token"]})