|
@@ -228,7 +228,9 @@ def issue_email_code(email: str) -> dict:
|
|
|
(email, code, now, now + SMS_TTL),
|
|
(email, code, now, now + SMS_TTL),
|
|
|
)
|
|
)
|
|
|
cur.execute("DELETE FROM email_codes WHERE expires_at < %s", (now - SMS_TTL,))
|
|
cur.execute("DELETE FROM email_codes WHERE expires_at < %s", (now - SMS_TTL,))
|
|
|
- demo = DEMO_MODE or not email_service.smtp_configured()
|
|
|
|
|
|
|
+ # 邮件演示模式只取决于真实邮件通道(Resend/SMTP)是否配置,
|
|
|
|
|
+ # 与短信通道的 PL_DEMO 解耦:生产已接 Resend,邮件验证码必须真实发送。
|
|
|
|
|
+ demo = not email_service.smtp_configured()
|
|
|
result = {"ok": True, "demo": demo}
|
|
result = {"ok": True, "demo": demo}
|
|
|
if demo:
|
|
if demo:
|
|
|
result["code"] = code
|
|
result["code"] = code
|