🐛 fix(users.py): assign the hashed new password to a variable before updating the user's password to ensure consistency
✅ test(test_user.py): add test to verify if the new password works after resetting it
This commit is contained in:
parent
f95a38a4b5
commit
01a289dd9a
2 changed files with 6 additions and 2 deletions
|
|
@ -121,8 +121,8 @@ def reset_password(
|
|||
|
||||
if not user:
|
||||
raise HTTPException(status_code=404, detail="User not found")
|
||||
|
||||
user.password = get_password_hash(user_update.password)
|
||||
new_password = get_password_hash(user_update.password)
|
||||
user.password = new_password
|
||||
session.commit()
|
||||
session.refresh(user)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue