Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- api/main.py +9 -1
api/main.py
CHANGED
|
@@ -1388,7 +1388,15 @@ async def forgot_password(request: Request):
|
|
| 1388 |
"error": "Email could not be delivered. Check SMTP settings."
|
| 1389 |
}
|
| 1390 |
|
| 1391 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1392 |
return {"message": "If that email is registered, a reset code has been sent."}
|
| 1393 |
|
| 1394 |
|
|
|
|
| 1388 |
"error": "Email could not be delivered. Check SMTP settings."
|
| 1389 |
}
|
| 1390 |
|
| 1391 |
+
# If email not found — still return 200 but in dev mode show clear message
|
| 1392 |
+
smtp_configured = bool(os.environ.get("SMTP_EMAIL") and os.environ.get("SMTP_PASSWORD"))
|
| 1393 |
+
if not smtp_configured:
|
| 1394 |
+
return {
|
| 1395 |
+
"message": "Email not found in database",
|
| 1396 |
+
"dev_otp": None,
|
| 1397 |
+
"dev_mode": True,
|
| 1398 |
+
"dev_error": "No account found with this email. Please register first."
|
| 1399 |
+
}
|
| 1400 |
return {"message": "If that email is registered, a reset code has been sent."}
|
| 1401 |
|
| 1402 |
|