feat: passwords need 8 characters or more, on the Site and in the Kanban
All checks were successful
Build and deploy / Validate source (push) Successful in 7s
Build and deploy / Integration suite on a real stack (push) Successful in 3m28s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m2s
All checks were successful
Build and deploy / Validate source (push) Successful in 7s
Build and deploy / Integration suite on a real stack (push) Successful in 3m28s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m2s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@ class UserIn(StrictModel):
|
||||
name: str = Field(min_length=1, max_length=80)
|
||||
email: str = Field(min_length=3, max_length=254)
|
||||
role: Literal['admin', 'gestao', 'operador', 'vendedor']
|
||||
password: str | None = Field(default=None, min_length=12, max_length=128)
|
||||
password: str | None = Field(default=None, min_length=8, max_length=128)
|
||||
active: bool = True
|
||||
machines: list[UUID] = Field(default_factory=list, max_length=50)
|
||||
# The team's alerts by e-mail: orders paid, carts waiting for review, payments to look at.
|
||||
@@ -49,7 +49,7 @@ class MachineIn(StrictModel):
|
||||
|
||||
class PasswordChange(StrictModel):
|
||||
current: str = Field(min_length=1, max_length=128)
|
||||
new: str = Field(min_length=12, max_length=128)
|
||||
new: str = Field(min_length=8, max_length=128)
|
||||
|
||||
|
||||
@router.get('/api/operator/me')
|
||||
@@ -112,7 +112,7 @@ def set_machines(c, uid, machines):
|
||||
@router.post('/api/operator/users')
|
||||
def create_user(body: UserIn, request: Request, user=Depends(can('users'))):
|
||||
if not body.password:
|
||||
raise HTTPException(422, 'Defina uma senha inicial com 12 caracteres ou mais.')
|
||||
raise HTTPException(422, 'Defina uma senha inicial com 8 caracteres ou mais.')
|
||||
uid = uuid4()
|
||||
with db.connect() as c:
|
||||
if c.execute('SELECT 1 FROM dtf_local.operators WHERE email=%s', (body.email,)).fetchone():
|
||||
|
||||
Reference in New Issue
Block a user