authrocket 2.0.3 → 2.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: 27674ebcbfe9078ba6fa3a64478300fa963881d1
4
- data.tar.gz: b182499cc381c10331f63e71d10b78d9f2096c4e
3
+ metadata.gz: 37f37dc00fd966b7ee4a814d96dd74887ad28766
4
+ data.tar.gz: d1c970139d94933366d970465d55945192645dc0
5
5
  SHA512:
6
- metadata.gz: 19a6b03fbc2b51719d0889be25cb91dc2df8712f81fd22394f8dc1e54f8ab0741e0dadd3580dd3026fe335be661fa90adb2ed50fa6fb4e85726e06c15c261c35
7
- data.tar.gz: b3fd665fde7353d078fec2b55a02910fa5099cec146c060f727b3c3c75562228de21c2fa8ea765ab5f16f7150cab32473cb2e0f6f468b88134cf33433f00c52e
6
+ metadata.gz: 40969c9aba8cb99c074179f23fb14cb57f7594acecb9e25e6e45511a4c5d4c916f3d92e82571ee9181ffcb00816d54b201ccb1114c7ef8e14b36d0bf47765c9f
7
+ data.tar.gz: b39524bbbfb598427910fd665598e77d1b0307465c90b5d0cebb67b876380fc4505e6fd8dea4c6f80df381edb75e76bc179b73eb3f38b2a1bb7e4712467c1b0a
@@ -1,3 +1,7 @@
1
+ #### 2.1.0
2
+ - AuthProvider.authorize, #authorize_token can now return a UserToken
3
+ - Add UserToken#credential_type
4
+
1
5
  #### 2.0.3
2
6
  - Fix error handling for missing jwt_secret
3
7
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2016 Notioneer, Inc.
1
+ Copyright (c) 2014-2017 Notioneer, Inc.
2
2
 
3
3
  MIT License
4
4
 
@@ -1,3 +1,3 @@
1
1
  module AuthRocket
2
- VERSION = '2.0.3'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -50,7 +50,11 @@ module AuthRocket
50
50
  def self.authorize(attribs={})
51
51
  params = parse_request_params(attribs)
52
52
  parsed, creds = request(:post, url+'/authorize', params)
53
- User.new(parsed, creds)
53
+ if parsed[:data][:object] == 'user_token'
54
+ UserToken.new(parsed, creds)
55
+ else
56
+ User.new(parsed, creds)
57
+ end
54
58
  end
55
59
 
56
60
  # attribs - :access_token - required
@@ -58,7 +62,11 @@ module AuthRocket
58
62
  def authorize_token(attribs={})
59
63
  params = parse_request_params(attribs)
60
64
  parsed, creds = request(:post, url+'/authorize', params)
61
- User.new parsed, creds
65
+ if parsed[:data][:object] == 'user_token'
66
+ UserToken.new(parsed, creds)
67
+ else
68
+ User.new(parsed, creds)
69
+ end
62
70
  end
63
71
 
64
72
  end
@@ -2,9 +2,8 @@ module AuthRocket
2
2
  class UserToken < Resource
3
3
  crud :find, :create
4
4
 
5
- attr :username
5
+ attr :credential_type, :email, :username
6
6
  attr :first_name, :last_name, :password, :password_confirmation
7
- attr :email
8
7
 
9
8
  end
10
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authrocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AuthRocket Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-26 00:00:00.000000000 Z
11
+ date: 2017-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ncore