Skip to content

optimify-studio/telegram-auth

 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%