Implement password change API endpoint

This commit is contained in:
2025-07-16 08:39:22 +02:00
parent 45ae0929e6
commit 37f381c884
2 changed files with 54 additions and 1 deletions

View File

@ -257,3 +257,18 @@ class AuditQueryFilter(AuditFilter):
offset: int = 0
limit: int = 100
class UserPasswordChange(BaseModel):
"""Model for changing the password of a user."""
current_password: str
new_password: str
new_password_confirm: str
@model_validator(mode="after")
def validate_passwords(self) -> Self:
"""Validate that the passwords match."""
if self.new_password != self.new_password_confirm:
raise ValueError("Passwords don't match")
return self