Update code in endpoints/string.post.py

This commit is contained in:
Backend IM Bot 2025-03-14 09:19:04 -05:00
parent 1c1667f15c
commit c96535006d

34
endpoints/string.post.py Normal file
View File

@ -0,0 +1,34 @@
from fastapi import APIRouter, Depends, HTTPException
from core.database import fake_users_db
import uuid
router = APIRouter()
@router.post("/signup")
async def signup_handler(
username: str,
email: str,
password: str,
db: Session = Depends(get_db)
):
"""Demo signup endpoint"""
if username in fake_users_db:
raise HTTPException(status_code=400, detail="Username already exists")
user_id = str(uuid.uuid4())
fake_users_db[username] = {
"id": user_id,
"email": email,
"password": password,
"disabled": False
}
return {
"message": "User created successfully",
"user_id": user_id,
"username": username,
"next_steps": [
"Verify your email (demo)",
"Complete profile setup"
]
}