warden-oauth2-strategies 0.0.9 → 0.1.0

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
  SHA1:
3
- metadata.gz: a3b04b43a1ab21e63c96d813798df131ca000cd6
4
- data.tar.gz: 13a5a55111b8e549714c0549c8a8e54752e6ce8d
3
+ metadata.gz: 5b19bf4bebd18153ebe1cca675986f8792d62101
4
+ data.tar.gz: b38ed60cfdcb9735f42de0f202ca4ca87aee8123
5
5
  SHA512:
6
- metadata.gz: d43b39328c1c571dbe0918ed64a7bad19da8ee5d616f905fe3b18c60662afaf64fcd188d841a424b95aea9ee423dab9ffdf899947901ee7636f0f362408122da
7
- data.tar.gz: dc5d9fae7c83be21f6b04d50ab6dafd890e7ab24016f1a35fc7f2f96e052b29bf3a193fb3f8287b6bc7c1dce427fab258ba90e5c9e1e67593aecf560fd03b76f
6
+ metadata.gz: df28174f8ac1d2935ade911f23e965953d8101891c33ae1d70e7118c6ad2092a1856118b2be2f99470a197949845df77386cd0bdd494f475e28fa34bb5a6d971
7
+ data.tar.gz: 3b410cf14da8fe3a3b9c322f98d08df551a60685830c998972ef39b9867e66f9cf9a2d998ee9147714f10a7043dde218aaf523935f468f73a70e176ac4b880c4
@@ -16,10 +16,15 @@ module Warden
16
16
  def client_authenticated
17
17
  if params['username'] && params['password']
18
18
  valid_client = client.valid?(username: params['username'], password: params['password'])
19
- valid_client ? super : fail('invalid_client')
19
+ if valid_client
20
+ super
21
+ else
22
+ fail('invalid_client')
23
+ self.error_description = 'Incorrect username or password'
24
+ end
20
25
  else
21
26
  fail('invalid_request')
22
- self.error_description = 'Incorrect username or password'
27
+ self.error_description = 'Empty username or password'
23
28
  end
24
29
  end
25
30
  end
@@ -1,5 +1,5 @@
1
1
  module Warden
2
2
  module OAuth2
3
- VERSION = '0.0.9'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
@@ -32,15 +32,16 @@ describe Warden::OAuth2::Strategies::ResourceOwnerPasswordCredentials do
32
32
  client_model.stub(locate: client_instance)
33
33
  subject.stub(:params).and_return('client_id' => 'awesome', 'username' => 'someuser', 'password' => 'incorrect')
34
34
  subject._run!
35
- subject.message.should == 'invalid_client'
36
35
  subject.error_status.should == 401
36
+ subject.message.should == 'invalid_client'
37
+ subject.error_description.should_not be_empty
37
38
  end
38
39
  it 'should fail if username and password are not provided' do
39
40
  client_model.stub(locate: double)
40
41
  subject.stub(:params).and_return('client_id' => 'awesome')
41
42
  subject._run!
42
- subject.message.should == 'invalid_request'
43
43
  subject.error_status.should == 400
44
+ subject.message.should == 'invalid_request'
44
45
  subject.error_description.should_not be_empty
45
46
  end
46
47
  it 'should pass username and password to validation check' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden-oauth2-strategies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AirService