♻️ Update password max length (#1447)
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
This commit is contained in:
@@ -14,19 +14,19 @@ class UserBase(SQLModel):
|
|||||||
|
|
||||||
# Properties to receive via API on creation
|
# Properties to receive via API on creation
|
||||||
class UserCreate(UserBase):
|
class UserCreate(UserBase):
|
||||||
password: str = Field(min_length=8, max_length=40)
|
password: str = Field(min_length=8, max_length=128)
|
||||||
|
|
||||||
|
|
||||||
class UserRegister(SQLModel):
|
class UserRegister(SQLModel):
|
||||||
email: EmailStr = Field(max_length=255)
|
email: EmailStr = Field(max_length=255)
|
||||||
password: str = Field(min_length=8, max_length=40)
|
password: str = Field(min_length=8, max_length=128)
|
||||||
full_name: str | None = Field(default=None, max_length=255)
|
full_name: str | None = Field(default=None, max_length=255)
|
||||||
|
|
||||||
|
|
||||||
# Properties to receive via API on update, all are optional
|
# Properties to receive via API on update, all are optional
|
||||||
class UserUpdate(UserBase):
|
class UserUpdate(UserBase):
|
||||||
email: EmailStr | None = Field(default=None, max_length=255) # type: ignore
|
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=128)
|
||||||
|
|
||||||
|
|
||||||
class UserUpdateMe(SQLModel):
|
class UserUpdateMe(SQLModel):
|
||||||
@@ -35,8 +35,8 @@ class UserUpdateMe(SQLModel):
|
|||||||
|
|
||||||
|
|
||||||
class UpdatePassword(SQLModel):
|
class UpdatePassword(SQLModel):
|
||||||
current_password: str = Field(min_length=8, max_length=40)
|
current_password: str = Field(min_length=8, max_length=128)
|
||||||
new_password: str = Field(min_length=8, max_length=40)
|
new_password: str = Field(min_length=8, max_length=128)
|
||||||
|
|
||||||
|
|
||||||
# Database model, database table inferred from class name
|
# Database model, database table inferred from class name
|
||||||
@@ -110,4 +110,4 @@ class TokenPayload(SQLModel):
|
|||||||
|
|
||||||
class NewPassword(SQLModel):
|
class NewPassword(SQLModel):
|
||||||
token: str
|
token: str
|
||||||
new_password: str = Field(min_length=8, max_length=40)
|
new_password: str = Field(min_length=8, max_length=128)
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ export const NewPasswordSchema = {
|
|||||||
},
|
},
|
||||||
new_password: {
|
new_password: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
maxLength: 40,
|
maxLength: 128,
|
||||||
minLength: 8,
|
minLength: 8,
|
||||||
title: 'New Password'
|
title: 'New Password'
|
||||||
}
|
}
|
||||||
@@ -258,13 +258,13 @@ export const UpdatePasswordSchema = {
|
|||||||
properties: {
|
properties: {
|
||||||
current_password: {
|
current_password: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
maxLength: 40,
|
maxLength: 128,
|
||||||
minLength: 8,
|
minLength: 8,
|
||||||
title: 'Current Password'
|
title: 'Current Password'
|
||||||
},
|
},
|
||||||
new_password: {
|
new_password: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
maxLength: 40,
|
maxLength: 128,
|
||||||
minLength: 8,
|
minLength: 8,
|
||||||
title: 'New Password'
|
title: 'New Password'
|
||||||
}
|
}
|
||||||
@@ -306,7 +306,7 @@ export const UserCreateSchema = {
|
|||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
maxLength: 40,
|
maxLength: 128,
|
||||||
minLength: 8,
|
minLength: 8,
|
||||||
title: 'Password'
|
title: 'Password'
|
||||||
}
|
}
|
||||||
@@ -367,7 +367,7 @@ export const UserRegisterSchema = {
|
|||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
maxLength: 40,
|
maxLength: 128,
|
||||||
minLength: 8,
|
minLength: 8,
|
||||||
title: 'Password'
|
title: 'Password'
|
||||||
},
|
},
|
||||||
@@ -430,7 +430,7 @@ export const UserUpdateSchema = {
|
|||||||
anyOf: [
|
anyOf: [
|
||||||
{
|
{
|
||||||
type: 'string',
|
type: 'string',
|
||||||
maxLength: 40,
|
maxLength: 128,
|
||||||
minLength: 8
|
minLength: 8
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user