Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update password max length #1447

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions backend/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ class UserBase(SQLModel):

# Properties to receive via API on creation
class UserCreate(UserBase):
password: str = Field(min_length=8, max_length=40)
password: str = Field(min_length=8, max_length=45)


class UserRegister(SQLModel):
email: EmailStr = Field(max_length=255)
password: str = Field(min_length=8, max_length=40)
password: str = Field(min_length=8, max_length=45)
full_name: str | None = Field(default=None, max_length=255)


# Properties to receive via API on update, all are optional
class UserUpdate(UserBase):
email: EmailStr | None = Field(default=None, max_length=255) # type: ignore
password: str | None = Field(default=None, min_length=8, max_length=40)
password: str | None = Field(default=None, min_length=8, max_length=45)


class UserUpdateMe(SQLModel):
Expand All @@ -35,8 +35,8 @@ class UserUpdateMe(SQLModel):


class UpdatePassword(SQLModel):
current_password: str = Field(min_length=8, max_length=40)
new_password: str = Field(min_length=8, max_length=40)
current_password: str = Field(min_length=8, max_length=45)
new_password: str = Field(min_length=8, max_length=45)


# Database model, database table inferred from class name
Expand Down Expand Up @@ -111,4 +111,4 @@ class TokenPayload(SQLModel):

class NewPassword(SQLModel):
token: str
new_password: str = Field(min_length=8, max_length=40)
new_password: str = Field(min_length=8, max_length=45)
Loading