-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webhook secret_token verification #201
Comments
Yes, it doesn't support token verification at the moment. As a workaround you can have something like this Telegram::Bot::Middleware.prepend(Module.new do
def call(env)
verify_token(env)
super
end
end) |
@printercu thank you! I'd like to avoid monkey-patching, is there a specific reason why the |
Because it's not available in the poller mode. Maybe it makes sense to pass it in the webhook mode and set to nil in the poller mode. |
@printercu definitely. |
Webhook may have a secret_token set, which will be sent in a
X-Telegram-Bot-Api-Secret-Token
header and could be verified.Didn't find a default functionality for that, tried to add a
before_action
, but it fails withundefined local variable or method 'request' for #<Telegram::WebhookController:0x0000000011acd8>
.Am I missing something? How do I access request headers?
I guess the only way is to override middleware?
The text was updated successfully, but these errors were encountered: