-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
the user model has a unique=True but the route only checks for existing email, not username
class User(Base):
__tablename__ = "users"
id = Column(Uuid(as_uuid=True), primary_key=True, index=True, default=uuid.uuid4)
user_name = Column(String, unique=True, index=True)
email = Column(String, unique=True, index=True)
And:
@router.post("/signup")
async def signup(user: CreateUser, db=Depends(get_db)):
existing_user = db.query(User).filter(User.email == user.email).first()
if existing_user:
raise HTTPException(status_code=400, detail="Email already registered")
Metadata
Metadata
Assignees
Labels
No labels