This commit is contained in:
@@ -55,7 +55,7 @@ def verify_password(plain_password, hashed_password):
|
||||
def get_password_hash(password):
|
||||
return pwd_context.hash(password)
|
||||
|
||||
def authenticate_user(name, password):
|
||||
def authenticate_user(db, name, password):
|
||||
user = get_user(db, name)
|
||||
if len(user) == 0:
|
||||
return False
|
||||
@@ -97,7 +97,7 @@ async def login_for_access_token(
|
||||
form_data: OAuth2PasswordRequestForm = Depends(),
|
||||
db=Depends(get_db)
|
||||
):
|
||||
user = authenticate_user(form_data.username, form_data.password)
|
||||
user = authenticate_user(db, form_data.username, form_data.password)
|
||||
username = form_data.username
|
||||
if not user:
|
||||
raise HTTPException(
|
||||
|
||||
Reference in New Issue
Block a user