feat(api): add update password

This commit is contained in:
2025-06-27 13:31:32 +05:00
parent 1eadd834e3
commit ad0a4837fc
4 changed files with 26 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ from api.db.logic.account import (
get_user_by_login,
update_user_by_id,
)
from api.db.logic.keyring import create_password_key
from api.db.logic.keyring import create_password_key, update_password_key
from api.db.tables.account import AccountStatus
from api.schemas.account.account import User
from api.schemas.base import bearer_schema
@@ -95,6 +95,9 @@ async def update_account(
if user is None:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Account not found")
if user_update.password is not None:
await update_password_key(connection, user.id, user_update.password)
update_values = update_user_data_changes(user_update, user)
if update_values is None: