Secure users API and handle manual password recovery.

This commit is contained in:
grossmj committed 2021-04-19 09:40:04 +09:30
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,