[rewrite] WIP login and register

This commit is contained in:
Thastertyn committed 2025-03-11 21:53:37 +01:00
1 parent f5547be799
commit cd8fdb9c21
9 files changed
+38 -62

No files matched your search

+1 -10
View File
@@ -2,22 +2,13 @@ from sqlmodel import Field as SqlModelField, SQLModel
from pydantic import EmailStr, Field
class UserRegisterSchema(SQLModel):
class UserRegister(SQLModel):
username: str = Field(..., min_length=3, max_length=64)
email: EmailStr = Field(...)
phone_number: str = Field(..., min_length=2, max_length=16, pattern=r'^\+[1-9]\d{1,14}$')
password: str = Field(..., min_length=6, max_length=128)
shop_id: int = 0
class Config:
from_attributes = True
class UserLoginSchema(SQLModel):
shop_id: int = 0
username: str = Field(..., min_length=3, max_length=64)
password: str = Field(..., min_length=6, max_length=128)
class Token(SQLModel):
access_token: str