diff --git a/src/TelegramDriver.php b/src/TelegramDriver.php index 78c07b1..21cb3ff 100644 --- a/src/TelegramDriver.php +++ b/src/TelegramDriver.php @@ -61,6 +61,12 @@ public function buildPayload(Request $request) $this->event = Collection::make($message); $this->config = Collection::make($this->config->get('telegram')); $this->queryParameters = Collection::make($request->query); + + $token = $request->headers->get('X-Telegram-Bot-Api-Secret-Token'); + + if ($token !== str_replace(':', '_', $this->config->get('token'))) { + throw new \Exception('Token mismatch!'); + } } /**