updated crud for restricting authentication for disabled users
Browse files- core/crud.py +2 -0
core/crud.py
CHANGED
@@ -21,6 +21,8 @@ def authenticate_user(username: str, password: str):
|
|
21 |
return False
|
22 |
if not utils.verify_password(password, user.password):
|
23 |
return False
|
|
|
|
|
24 |
return user
|
25 |
|
26 |
|
|
|
21 |
return False
|
22 |
if not utils.verify_password(password, user.password):
|
23 |
return False
|
24 |
+
if user.disabled:
|
25 |
+
raise HTTPException(status_code=400, detail="Inactive user")
|
26 |
return user
|
27 |
|
28 |
|