feat: auth & admin
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""Self-service user endpoints (the authenticated caller acts on themselves)."""
|
||||
|
||||
from fastapi import APIRouter, status
|
||||
|
||||
from app.api.deps import CurrentUser, UserServiceDep
|
||||
from app.api.schemas.user import ChangePasswordRequest
|
||||
|
||||
router = APIRouter(prefix="/users", tags=["users"])
|
||||
|
||||
|
||||
@router.patch("/me/password", status_code=status.HTTP_204_NO_CONTENT)
|
||||
async def change_my_password(
|
||||
body: ChangePasswordRequest, user: CurrentUser, users: UserServiceDep
|
||||
) -> None:
|
||||
await users.change_password(
|
||||
user.id,
|
||||
current_password=body.current_password,
|
||||
new_password=body.new_password,
|
||||
)
|
||||
Reference in New Issue
Block a user