feat: add change password

This commit is contained in:
2026-06-08 11:55:51 +03:00
parent 6d7df5836a
commit e208792738
9 changed files with 120 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
from fastapi import APIRouter, Depends, Request
from fastapi.responses import ORJSONResponse
from starlette import status
from src.presentation.dependencies.commands import get_set_password_command
from src.application.commands.set_password import SetPasswordCommand
from presentation.schemas.password import SetPasswordRequest
users_router = APIRouter(prefix='/users', tags=['users'])
@users_router.patch(path='/password', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
async def set_password(
request: Request,
body: SetPasswordRequest,
command: SetPasswordCommand = Depends(get_set_password_command),
):
await command(email=body.email, password=body.password)
return ORJSONResponse(content={'message': 'Password updated successfully'})