diff --git a/backend/main.py b/backend/main.py index 595bfa4..cd0b5c4 100644 --- a/backend/main.py +++ b/backend/main.py @@ -93,6 +93,7 @@ def register(req: RegisterRequest, db: Session = Depends(get_db)): email = req.email.strip().lower() if not email or not req.password: raise HTTPException(status_code=400, detail="Email and password are required") + pw_bytes_len = len(req.password.encode("utf-8")) _password_ok_or_400(req.password) try: @@ -118,7 +119,10 @@ def register(req: RegisterRequest, db: Session = Depends(get_db)): raise HTTPException(status_code=500, detail=f"Database error: {str(e)}") except Exception as e: db.rollback() - raise HTTPException(status_code=500, detail=f"Internal error: {str(e)}") + raise HTTPException( + status_code=500, + detail=f"Internal error: {str(e)} (password_bytes_len={pw_bytes_len})", + ) @app.post("/auth/login")