omniauth-protons 0.2.2 → 0.4

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: cb7d2b91479fac5929d8015acf9a940b946fda6f
4
- data.tar.gz: ecf8c9547558b27681b88211e55048d6a10f3153
3
+ metadata.gz: af9f64b311700fbb0cef815b8845d74aba16d504
4
+ data.tar.gz: 5f40b5f35f79bb620b6b1740e2d3bc3dcac12a48
5
5
  SHA512:
6
- metadata.gz: a027f246273768fdc9ba64c8a085512726870a09555591cc1a9246b799570d3a4ec5ca0c3d9a4f6d0c7eba9cc5c3c62623925de50b60acffe147aa287a4d6fd2
7
- data.tar.gz: bdf45ef976ced380e751f88df61a12de6c19c9a42054745ce2b0f4610f3f044e980222a90b98183e390e561aea82e0aa46d5b89abaedcc80d77ba41d5182c6a5
6
+ metadata.gz: bfbf21ac2a8934f9b159697787bba52738a4d51264ff5bd136ab81ab1497a81c493b583b863762a74c12313a53f156cde00bc6a795d72be257dca05bb6b7af47
7
+ data.tar.gz: c37eac4153c55fb2a620370d7a95c450da84c4a739c1667a9002e2afce6208ddd7b7e01c6c37882647e53d25dcddb39cc8a782a9d332c32620a4d164308cc0e5
data/.gitignore CHANGED
@@ -16,3 +16,6 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  *.swp
19
+
20
+ # Idea folder
21
+ .idea
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Protons
3
- VERSION = "0.2.2"
3
+ VERSION = '0.4'
4
4
  end
5
5
  end
@@ -1,5 +1,8 @@
1
1
  require 'omniauth/strategies/oauth2'
2
2
 
3
+ MAIN_DOMAIN = Rails.env.development? ? 'http://8protons.dev' : 'https://8protons.com'
4
+ API_DOMAIN = Rails.env.development? ? 'http://api8p.com' : 'https://api8p.com'
5
+
3
6
  module OmniAuth
4
7
  module Strategies
5
8
  # Authentication strategy for connecting with APIs constructed using
@@ -12,23 +15,31 @@ module OmniAuth
12
15
  option :name, :protons
13
16
 
14
17
  option :client_options, {
15
- :site => Rails.env.development? ? "http://8protons.dev" : "https://8protons.com",
16
- :authorize_url => "/oauth/authorize"
18
+ site: MAIN_DOMAIN,
19
+ token_url: "#{API_DOMAIN}/oauth2/tokens",
20
+ #authorize_url: '/oauth/auth'
17
21
  }
18
22
 
19
- uid { raw_info["id"] }
23
+ uid { raw_info['id'] }
20
24
 
21
25
  info do
22
26
  {
23
- :name => raw_info["display_name"],
24
- :email => raw_info["email"],
25
- :nickname => raw_info["username"]
27
+ name: raw_info['fields']['display_name'],
28
+ email: raw_info['fields']['email'],
29
+ nickname: raw_info['fields']['username']
30
+ #:gravatar_hash => raw_info['fields']['gravatar_hash']
26
31
  # and anything else you want to return to your API consumers
27
32
  }
28
33
  end
29
34
 
35
+ extra do
36
+ {
37
+ 'raw_info' => raw_info
38
+ }
39
+ end
40
+
30
41
  def raw_info
31
- @raw_info ||= access_token.get('/api/users/me.json').parsed
42
+ @raw_info ||= access_token.get("#{API_DOMAIN}/base/me").parsed
32
43
  end
33
44
  end # Protons
34
45
  end
@@ -1,2 +1,2 @@
1
- require "omniauth/protons/version"
1
+ require 'omniauth/protons/version'
2
2
  require 'omniauth/strategies/protons'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-protons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Sekatski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-26 00:00:00.000000000 Z
11
+ date: 2014-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2