Fix token issue
This commit is contained in:
@@ -99,6 +99,7 @@ class UserUpdate(BaseModel):
|
||||
phone: Optional[str] = None
|
||||
language: Optional[str] = Field(None, pattern="^(es|en)$")
|
||||
timezone: Optional[str] = None
|
||||
tenant_id: Optional[str] = None
|
||||
|
||||
@validator('phone')
|
||||
def validate_phone(cls, v):
|
||||
|
||||
@@ -39,6 +39,9 @@ class AuthService:
|
||||
detail="Email already registered"
|
||||
)
|
||||
|
||||
# Generate tenant_id if not provided
|
||||
tenant_id = user_data.tenant_id if hasattr(user_data, 'tenant_id') and user_data.tenant_id else str(uuid.uuid4())
|
||||
|
||||
# Hash password
|
||||
hashed_password = security_manager.hash_password(user_data.password)
|
||||
|
||||
@@ -46,6 +49,7 @@ class AuthService:
|
||||
user = User(
|
||||
email=user_data.email,
|
||||
hashed_password=hashed_password,
|
||||
tenant_id=tenant_id,
|
||||
full_name=user_data.full_name,
|
||||
phone=user_data.phone,
|
||||
language=user_data.language,
|
||||
@@ -61,6 +65,7 @@ class AuthService:
|
||||
event_data = {
|
||||
"user_id": str(user.id),
|
||||
"email": user.email,
|
||||
"tenant_id": user.tenant_id,
|
||||
"full_name": user.full_name,
|
||||
"language": user.language,
|
||||
"timestamp": datetime.now(timezone.utc).isoformat()
|
||||
|
||||
Reference in New Issue
Block a user