Skip to content

Commit 3457a53

Browse files
committed
chore(ops): remove emergency debug tools
1 parent a3dde52 commit 3457a53

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

backend/main.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,34 +65,6 @@
6565
app = FastAPI(title="TraderCopilot Backend", version="2.0.0")
6666

6767

68-
# --- EMERGENCY ENDPOINT (TEMPORARY) ---
69-
@app.get("/debug/force-reset")
70-
def force_reset_password(email: str, new_pass: str, db: Session = Depends(get_db)):
71-
"""
72-
Emergency tool to fix 'UnknownHashError' in Prod.
73-
Usage: /debug/force-reset?email=admin@tradercopilot.app&new_pass=123456
74-
"""
75-
from core.security import get_password_hash
76-
from models_db import User
77-
78-
user = db.query(User).filter(User.email == email).first()
79-
if not user:
80-
return {"error": "User not found"}
81-
82-
print(f"[DEBUG] Resetting password for {email}...")
83-
user.hashed_password = get_password_hash(new_pass)
84-
db.commit()
85-
return {"status": "success", "message": f"Password updated for {email}"}
86-
87-
@app.get("/debug/users")
88-
def debug_list_users(db: Session = Depends(get_db)):
89-
"""List all registered users (EMAIL ONLY) to find the admin account."""
90-
from models_db import User
91-
users = db.query(User).all()
92-
return {"count": len(users), "emails": [u.email for u in users]}
93-
# --- END EMERGENCY ---
94-
95-
9668
@app.get("/")
9769
def root_check():
9870
"""Root endpoint for instant health check."""

0 commit comments

Comments
 (0)