telegram-auth
Gem to implement authorization checks for telegram logins outlined here.
Installation
gem install telegram-auth
Interactive console at bin/console
from source.
Configuration
Telegram::Auth.configure do |c|
c.token = "XXXXX" #get this from the telegram domain bot
c.auth_expires_in = 1.hour.to_i #optional
end
To raise an error for invalid configuration use:
Telegram::Auth.configure!{ |c| ... }
Usage
Telegram::Auth.create(hash:, username: id: first_name: last_name: auth_date: photo_url:) do |error|
Telegram::Auth.logger.debug(error.message)
end
Logging
Auth failures are logged at DEBUG to STDOUT. To configure your own logger:
Telegram::Auth.logger = Rails.logger #or your logger
Telegram::Auth.logger.level = Logger::WARN
Supported versions
- Jruby
- Ruby
- TruffleRuby