0.0
No commit activity in last 3 years
No release in over 3 years
Gem to verify the auth hash for a telegram domain login
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.1.4
~> 13.0
~> 3.9
~> 0.9.2
~> 1.8.8

Runtime

~> 2.2.0
 Project Readme

telegram-auth

build Coverage Status Maintainability Gem Version

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