khawir commited on
Commit
69728d5
·
1 Parent(s): 13bcdb0

updated crud for restricting authentication for disabled users

Browse files
Files changed (1) hide show
  1. 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