hoàn thành chức năng hiện username annotation của từng user

This commit is contained in:
2026-04-01 20:13:48 +07:00
parent 386871bd4a
commit 217e2f9712
7 changed files with 376 additions and 10 deletions
+12
View File
@@ -55,6 +55,18 @@ class UserRoleUpdate(BaseModel):
role: UserRole
class ChangePassword(BaseModel):
current_password: str
new_password: str
@field_validator("new_password")
@classmethod
def password_strength(cls, v: str) -> str:
if len(v) < 8:
raise ValueError("Password must be at least 8 characters.")
return v
class TokenPayload(BaseModel):
sub: int # user id
exp: int