Skip to content

Commit 3ba2c44

Browse files
Increase Password Length Limit
Further increase password length limit to address concerns around password entropy and make it multiple of 2.
1 parent 7b9c0bd commit 3ba2c44

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

backend/app/models.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ class UserBase(SQLModel):
1414

1515
# Properties to receive via API on creation
1616
class UserCreate(UserBase):
17-
password: str = Field(min_length=8, max_length=45)
17+
password: str = Field(min_length=8, max_length=128)
1818

1919

2020
class UserRegister(SQLModel):
2121
email: EmailStr = Field(max_length=255)
22-
password: str = Field(min_length=8, max_length=45)
22+
password: str = Field(min_length=8, max_length=128)
2323
full_name: str | None = Field(default=None, max_length=255)
2424

2525

2626
# Properties to receive via API on update, all are optional
2727
class UserUpdate(UserBase):
2828
email: EmailStr | None = Field(default=None, max_length=255) # type: ignore
29-
password: str | None = Field(default=None, min_length=8, max_length=45)
29+
password: str | None = Field(default=None, min_length=8, max_length=128)
3030

3131

3232
class UserUpdateMe(SQLModel):
@@ -35,8 +35,8 @@ class UserUpdateMe(SQLModel):
3535

3636

3737
class UpdatePassword(SQLModel):
38-
current_password: str = Field(min_length=8, max_length=45)
39-
new_password: str = Field(min_length=8, max_length=45)
38+
current_password: str = Field(min_length=8, max_length=128)
39+
new_password: str = Field(min_length=8, max_length=128)
4040

4141

4242
# Database model, database table inferred from class name
@@ -110,4 +110,4 @@ class TokenPayload(SQLModel):
110110

111111
class NewPassword(SQLModel):
112112
token: str
113-
new_password: str = Field(min_length=8, max_length=45)
113+
new_password: str = Field(min_length=8, max_length=128)

0 commit comments

Comments
 (0)