mirror of
https://git.victorphan.net/basketballcantho/ten-project.git
synced 2026-08-06 15:03:11 +07:00
hoàn thành chức năng hiện username annotation của từng user
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user