Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Simplify reset password logic by removing duplicate code #1440

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
lint: fix linting error
  • Loading branch information
youneshenniwrites committed Dec 3, 2024
commit cbd91390d12ec543652f592d2358ccbd5e752617
5 changes: 3 additions & 2 deletions backend/app/api/routes/login.py
Original file line number Diff line number Diff line change
@@ -90,11 +90,12 @@ def reset_password(session: SessionDep, body: NewPassword) -> Message:
)
if not user.is_active:
raise HTTPException(status_code=400, detail="Inactive user")


user_in_update = UserUpdate(password=body.new_password)
crud.update_user(
session=session,
db_user=user,
user_in={"password": body.new_password},
user_in=user_in_update,
)
return Message(message="Password updated successfully")

Loading
Oops, something went wrong.