GUI: Handle authentication failure
This commit is contained in:
1 parent
e607f872a6
commit
f783a887ed
1 file changed
+3
-1
@@ -28,11 +28,13 @@ def auth(base_url: str | None) -> str:
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
}
|
||||
)
|
||||
|
||||
if response.status_code == 200:
|
||||
response_json = response.json()
|
||||
if "access_token" in response_json:
|
||||
return response_json["access_token"]
|
||||
else:
|
||||
logger.error(f"Authentication request failed: {response.content}")
|
||||
raise Exception("Authentication request failed")
|
||||
|
||||
except requests.RequestException as e:
|
||||
logger.error(f"Authentication request failed: {e}")
|
||||
|
||||
Reference in new issue
Block a user