Skip to content

Commit c612641

Browse files
♻️ Update password max length (#1447)
Co-authored-by: Sofie Van Landeghem <[email protected]>
1 parent fd74a4d commit c612641

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
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=40)
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=40)
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=40)
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=40)
39-
new_password: str = Field(min_length=8, max_length=40)
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=40)
113+
new_password: str = Field(min_length=8, max_length=128)

frontend/src/client/schemas.gen.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export const NewPasswordSchema = {
202202
},
203203
new_password: {
204204
type: 'string',
205-
maxLength: 40,
205+
maxLength: 128,
206206
minLength: 8,
207207
title: 'New Password'
208208
}
@@ -258,13 +258,13 @@ export const UpdatePasswordSchema = {
258258
properties: {
259259
current_password: {
260260
type: 'string',
261-
maxLength: 40,
261+
maxLength: 128,
262262
minLength: 8,
263263
title: 'Current Password'
264264
},
265265
new_password: {
266266
type: 'string',
267-
maxLength: 40,
267+
maxLength: 128,
268268
minLength: 8,
269269
title: 'New Password'
270270
}
@@ -306,7 +306,7 @@ export const UserCreateSchema = {
306306
},
307307
password: {
308308
type: 'string',
309-
maxLength: 40,
309+
maxLength: 128,
310310
minLength: 8,
311311
title: 'Password'
312312
}
@@ -367,7 +367,7 @@ export const UserRegisterSchema = {
367367
},
368368
password: {
369369
type: 'string',
370-
maxLength: 40,
370+
maxLength: 128,
371371
minLength: 8,
372372
title: 'Password'
373373
},
@@ -430,7 +430,7 @@ export const UserUpdateSchema = {
430430
anyOf: [
431431
{
432432
type: 'string',
433-
maxLength: 40,
433+
maxLength: 128,
434434
minLength: 8
435435
},
436436
{

0 commit comments

Comments
 (0)