fix(email): resolve Tempmail.lol field drift and OTP anchor race condition

This commit is contained in:
Mison
2026-03-24 10:26:48 +08:00
parent 3c8ba40d2d
commit 67a446aca0
2 changed files with 51 additions and 3 deletions

View File

@@ -89,7 +89,11 @@ class TempmailService(BaseEmailService):
def _get_received_timestamp(self, message: Dict[str, Any]) -> Optional[float]:
"""返回 Tempmail 邮件的接收时间戳。"""
return self._parse_message_time(message.get("received_at"))
for field_name in ("received_at", "date", "created_at", "createdAt", "timestamp"):
timestamp = self._parse_message_time(message.get(field_name))
if timestamp is not None:
return timestamp
return None
def _save_token_to_db(self, email: str, token: str) -> None:
"""将邮箱 token 持久化到 Setting 表key=tempmail_token:{email}"""