Update code in endpoints/api/v1/endpoint.post.py
This commit is contained in:
parent
e7219ff2c3
commit
aa79fb5cd2
@ -9,9 +9,9 @@ class UserRegistration(BaseModel):
|
|||||||
username: str
|
username: str
|
||||||
email: EmailStr
|
email: EmailStr
|
||||||
password: str
|
password: str
|
||||||
full_name: str | None = None
|
full_name: str
|
||||||
|
|
||||||
@router.post("/register")
|
@router.post("/api/v1/endpoint")
|
||||||
async def register_user(user_data: UserRegistration):
|
async def register_user(user_data: UserRegistration):
|
||||||
"""Register a new user"""
|
"""Register a new user"""
|
||||||
if user_data.username in fake_users_db:
|
if user_data.username in fake_users_db:
|
||||||
@ -21,23 +21,22 @@ async def register_user(user_data: UserRegistration):
|
|||||||
fake_users_db[user_data.username] = {
|
fake_users_db[user_data.username] = {
|
||||||
"id": user_id,
|
"id": user_id,
|
||||||
"email": user_data.email,
|
"email": user_data.email,
|
||||||
"password": user_data.password, # In production, hash this password
|
"password": user_data.password,
|
||||||
"full_name": user_data.full_name,
|
"full_name": user_data.full_name,
|
||||||
"disabled": False,
|
"disabled": False
|
||||||
"created_at": str(datetime.now())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"message": "User registered successfully",
|
"message": "User registered successfully",
|
||||||
"user_id": user_id,
|
"user_id": user_id,
|
||||||
"username": user_data.username,
|
"username": user_data.username,
|
||||||
|
"metadata": {
|
||||||
|
"account_status": "active",
|
||||||
|
"registration_complete": True
|
||||||
|
},
|
||||||
"next_steps": [
|
"next_steps": [
|
||||||
"Verify your email address",
|
"Verify your email address",
|
||||||
"Complete your profile",
|
"Complete your profile",
|
||||||
"Set up two-factor authentication"
|
"Set up two-factor authentication"
|
||||||
],
|
]
|
||||||
"metadata": {
|
|
||||||
"account_status": "pending_verification",
|
|
||||||
"registration_date": str(datetime.now())
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user