fixed post token invalidation via mail/telegramm
This commit is contained in:
@@ -1613,6 +1613,12 @@ class DatabaseClient:
|
||||
lambda: self.client.table("email_action_tokens").update({"used": True}).eq("token", token).execute()
|
||||
)
|
||||
|
||||
async def mark_all_post_tokens_used(self, post_id: UUID) -> None:
|
||||
"""Mark all email action tokens for a post as used (invalidate approve + reject together)."""
|
||||
await asyncio.to_thread(
|
||||
lambda: self.client.table("email_action_tokens").update({"used": True}).eq("post_id", str(post_id)).execute()
|
||||
)
|
||||
|
||||
async def cleanup_expired_email_tokens(self) -> None:
|
||||
"""Delete expired email tokens from the database."""
|
||||
now = datetime.now(timezone.utc).isoformat()
|
||||
|
||||
Reference in New Issue
Block a user