mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-13 01:20:58 +00:00
Add back ValidationError
This commit is contained in:
parent
0be45c7da2
commit
efb84b3063
@ -24,6 +24,7 @@ from typing import Optional
|
|||||||
from fastapi import HTTPException, status
|
from fastapi import HTTPException, status
|
||||||
from gns3server.schemas.controller.tokens import TokenData
|
from gns3server.schemas.controller.tokens import TokenData
|
||||||
from gns3server.config import Config
|
from gns3server.config import Config
|
||||||
|
from pydantic import ValidationError
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -80,6 +81,6 @@ class AuthService:
|
|||||||
if username is None:
|
if username is None:
|
||||||
raise credentials_exception
|
raise credentials_exception
|
||||||
token_data = TokenData(username=username)
|
token_data = TokenData(username=username)
|
||||||
except (JoseError, ValueError):
|
except (JoseError, ValidationError, ValueError):
|
||||||
raise credentials_exception
|
raise credentials_exception
|
||||||
return token_data.username
|
return token_data.username
|
||||||
|
Loading…
Reference in New Issue
Block a user