feat(security): unify token validation for message endpoints

This commit is contained in:
InfinityPacer
2024-10-08 14:32:29 +08:00
parent 284082741e
commit 4f01b82b81
4 changed files with 8 additions and 21 deletions

View File

@@ -85,10 +85,6 @@ class TelegramModule(_ModuleBase, _MessageBase[Telegram]):
if not client_config:
return None
client: Telegram = self.get_instance(source)
# 校验token
token = args.get("token")
if not token or token != settings.API_TOKEN:
return None
try:
message: dict = json.loads(body)
except Exception as err: