telegram-ruby 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/telegram/bot/login.rb +1 -1
- data/lib/telegram/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3b1e7a9c5751ecc45a63b9dcf1ac0e2a09745397e3dc1babed2429b1dec1fe2
|
4
|
+
data.tar.gz: ff4a033d1d463d0bc37723aa85c9443d2736183442fc09b6c88cd0fdc65f9a83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1398d1b87930c7ad729df49c057e2b840c45ab6273cefb615fb66391a7bdc0a7cb22fa00a8613b0c6afeebe4ac2e1ba588036304d3394d457e32a5dcda9e2bda
|
7
|
+
data.tar.gz: baf81c76ee15444b47af23b7185abf8e9891bdeec3bcc0232a2721ea87b715119698d3e07f117b99df0d6ca28d33671a9f0dcd5940d8dabc46847046dc874afc
|
data/lib/telegram/bot/login.rb
CHANGED
@@ -7,7 +7,7 @@ module Telegram::Bot
|
|
7
7
|
auth_data = auth_data.slice(:auth_date, :first_name, :id, :last_name, :photo_url, :username)
|
8
8
|
check_string = auth_data.map {|k, v| "#{k}=#{v}" }.sort.join("\n")
|
9
9
|
|
10
|
-
secret_key = OpenSSL::Digest::SHA256.new.digest(
|
10
|
+
secret_key = OpenSSL::Digest::SHA256.new.digest(Bot.configuration.token)
|
11
11
|
hash = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), secret_key, check_string)
|
12
12
|
|
13
13
|
raise Telegram::Bot::LoginError.new('Data is NOT from Telegram') if (hash.casecmp(check_hash) != 0)
|
data/lib/telegram/version.rb
CHANGED