mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
auth: split JWT validation errors by failure cause
get_token_data used to raise the same "Could not validate credentials" for every JWT-level failure (bad signature, expired, malformed), which made console WebSocket auth failures impossible to tell apart. Return a distinct detail per cause and log the underlying exception plus the unverified header alg value on rejection.
This commit is contained in:
2 files changed
+37
-18
No files matched your search
@@ -106,7 +106,7 @@ class TestRoutes:
|
||||
async with aconnect_ws(path, client, params=params) as ws:
|
||||
json_notification = await ws.receive_json()
|
||||
assert json_notification['event'] == {
|
||||
'message': 'Could not authenticate while connecting to controller WebSocket: Could not validate credentials'
|
||||
'message': 'Could not authenticate while connecting to controller WebSocket: Invalid token (DecodeError)'
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user