mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Secure users API and handle manual password recovery.
This commit is contained in:
1 parent
c03226e368
commit
e28452f09a
7 files changed
+92
-39
No files matched your search
@@ -44,6 +44,10 @@ async def get_user_from_token(
|
||||
|
||||
async def get_current_active_user(current_user: schemas.User = Depends(get_user_from_token)) -> schemas.User:
|
||||
|
||||
# Super admin is always authorized
|
||||
if current_user.is_superadmin:
|
||||
return current_user
|
||||
|
||||
if not current_user.is_active:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
|
||||
Reference in new issue
Block a user