omniauth-quanto 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth-quanto.rb +2 -0
- data/lib/omniauth-quanto/version.rb +5 -0
- data/lib/omniauth/strategies/quanto.rb +45 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9117c70c08edb1f0e7c8bbb26a636fa384b21262
|
4
|
+
data.tar.gz: 587ac57582c17b76a6f8b79c00049123a081301e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cace7a4ccd68e622dab5bb3dde1ba3423a361c2958ca8ca54deb1b7db36539fa153a142df02e4928ee7bf713a4f8ead895e433a36195f8a7d2ea5b211e38b43f
|
7
|
+
data.tar.gz: 801d37f8f033ebbe3be8e0483f86d34ef6c935d1af8132cc9d2f988bc41594f0868d188828fd56d885779f96e6fcc5e4d15a8f7bcee3e8d52f513d78cb2ed414
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'oauth2'
|
2
|
+
require 'omniauth'
|
3
|
+
require 'omniauth-oauth2'
|
4
|
+
|
5
|
+
module OmniAuth
|
6
|
+
module Strategies
|
7
|
+
class Quanto < OmniAuth::Strategies::OAuth2
|
8
|
+
# Give your strategy a name.
|
9
|
+
option :name, :quanto
|
10
|
+
|
11
|
+
# This is where you pass the options you would pass when
|
12
|
+
# initializing your consumer from the OAuth gem.
|
13
|
+
option :client_options, {
|
14
|
+
site: 'http://quanto.herokuapp.com',
|
15
|
+
request_token_path: '/oauth/request_token',
|
16
|
+
access_token_path: '/oauth/access_token',
|
17
|
+
authorize_path: '/oauth/authorize',
|
18
|
+
}
|
19
|
+
|
20
|
+
# These are called after authentication has succeeded. If
|
21
|
+
# possible, you should try to set the UID without making
|
22
|
+
# additional calls (if the user id is returned with the token
|
23
|
+
# or as a URI parameter). This may not be possible with all
|
24
|
+
# providers.
|
25
|
+
uid{ raw_info['id'] }
|
26
|
+
|
27
|
+
info do
|
28
|
+
{
|
29
|
+
name: raw_info['name'],
|
30
|
+
email: raw_info['email'],
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
extra do
|
35
|
+
{
|
36
|
+
'raw_info' => raw_info
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
def raw_info
|
41
|
+
@raw_info ||= access_token.get('/api/v1/me').parsed
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-quanto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rasmus Rygaard
|
@@ -35,6 +35,9 @@ files:
|
|
35
35
|
- Gemfile
|
36
36
|
- LICENSE
|
37
37
|
- README.md
|
38
|
+
- lib/omniauth-quanto.rb
|
39
|
+
- lib/omniauth-quanto/version.rb
|
40
|
+
- lib/omniauth/strategies/quanto.rb
|
38
41
|
- omniauth-quanto.gemspec
|
39
42
|
homepage: http://github.com/rasmusrygaard/omniauth-quanto
|
40
43
|
licenses: []
|