glogin 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f95b5783be06871b3fcc570c2c931aa4805df8d9eba5fd3e56efdc324b828947
4
- data.tar.gz: 59bad949654ddf467ee7c3c7e520cb885682227fd2b19e2f52131a299d69e0ec
3
+ metadata.gz: 6960c45e5d074619ac8a5b4997f5fca734f445ffbf2ea203bf6264436af521ff
4
+ data.tar.gz: 6718628c2085dca6a4dae18a3eea5e0de734dfe99676530d7fc70d3dea166bf3
5
5
  SHA512:
6
- metadata.gz: 22863efe1b00bb8fb9da9727d173e2b884986496f50be8d1c4f7fead6f16383ac0be0f2ee5c2acb66834d558e67e290a6855b622e94738f86c729e371abe609d
7
- data.tar.gz: 822e2f1c55dada3a6cb2dd5cfc15f77ebb6762bab9f7ad23d270612d94e6489c3352f92973c6491e009d02af955a9522a734419dc6dac1d26b7da9edc9e88c2f
6
+ metadata.gz: fe27db59e34f29a75550a21641710a6f199bf9be582c065d0dd94aca1448a0193e2f481aeae5d642e29202e077355b684f5a3cc5e2a7639ba2f276edb475468b
7
+ data.tar.gz: ef9537ee5ec99726b5e02658a12905f35b411cc5aeaa139ca4a15902645e823504f24ffdd0ce1fe1cbbf35d60feb36ce686ba1bf94b8e4f98455cf09f7add689
data/lib/glogin/auth.rb CHANGED
@@ -102,7 +102,7 @@ module GLogin
102
102
  [
103
103
  '"',
104
104
  txt[0..prefix],
105
- '*' * (token.length - prefix),
105
+ '*' * (txt.length - prefix),
106
106
  '"'
107
107
  ].join
108
108
  end
@@ -26,5 +26,5 @@
26
26
  # Copyright:: Copyright (c) 2017-2024 Yegor Bugayenko
27
27
  # License:: MIT
28
28
  module GLogin
29
- VERSION = '0.16.0'
29
+ VERSION = '0.16.1'
30
30
  end
@@ -58,4 +58,11 @@ class TestAuth < Minitest::Test
58
58
  auth = GLogin::Auth.new('99999', '', 'http://www.example.com/github-oauth')
59
59
  assert_equal('yegor256', auth.user('1234567890')['login'])
60
60
  end
61
+
62
+ def test_failed_authentication
63
+ auth = GLogin::Auth.new('1234', '4433', 'https://example.org')
64
+ stub_request(:post, 'https://github.com/login/oauth/access_token').to_return(status: 401)
65
+ e = assert_raises { auth.user('437849732894732') }
66
+ assert(e.message.include?('with code "43784***'))
67
+ end
61
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glogin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko