feat: add invite code feature (create, validate, referrer tracking)
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import BaseModel, EmailStr, Field
|
||||
from pydantic import BaseModel, ConfigDict, EmailStr, Field
|
||||
|
||||
|
||||
class VerificationCreateRequest(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
username: str = Field(min_length=3, max_length=30)
|
||||
email: EmailStr
|
||||
password: str = Field(min_length=6)
|
||||
redirect_to: str | None = None
|
||||
invite_code: str | None = Field(
|
||||
default=None,
|
||||
min_length=8,
|
||||
max_length=8,
|
||||
pattern=r"^[ABCDEFGHJKMNPQRSTUVWXYZ23456789]{8}$",
|
||||
)
|
||||
|
||||
|
||||
class VerificationResendRequest(BaseModel):
|
||||
@@ -65,7 +73,3 @@ class PasswordResetConfirmRequest(BaseModel):
|
||||
email: EmailStr
|
||||
token: str = Field(pattern=r"^\d{6}$")
|
||||
new_password: str = Field(min_length=6)
|
||||
|
||||
|
||||
class PasswordResetResponse(BaseModel):
|
||||
message: str = "Password reset email sent"
|
||||
|
||||
Reference in New Issue
Block a user