omniauth-linkus 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth-linkus/version.rb +1 -1
- data/lib/omniauth/strategies/linkus.rb +18 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecace412c0a391450bcabd51b847c6697714e0b9
|
4
|
+
data.tar.gz: e4302b1ab7700454d7c89ec44e904e1942dc943c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3bba43093c13a979384c8d5a87dcc4e1d1ee56997bc2f6227c2175883f8b638bf4daa3dca2f70a57ab05e838ad2b84e566fb2765911a09c55afa112901204b7
|
7
|
+
data.tar.gz: 23b72d27efdb12d9f48a88d6f8c33b22461a2d4d8b7ea3810cb119ba1d0b96e1a1d19a238837107ecf4fb30b95e393835fbd8a7570ac59a73d137bf309429788
|
@@ -3,6 +3,24 @@ require 'omniauth-oauth2'
|
|
3
3
|
module OmniAuth
|
4
4
|
module Strategies
|
5
5
|
class Linkus < OmniAuth::Strategies::OAuth2
|
6
|
+
RAW_INFO_URL = 'api/v1/users/me'
|
7
|
+
|
8
|
+
uid { raw_info['uid'] }
|
9
|
+
|
10
|
+
info do
|
11
|
+
{
|
12
|
+
sid: raw_info['sid'],
|
13
|
+
name: raw_info['name']
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
extra do
|
18
|
+
{ raw_info: raw_info }
|
19
|
+
end
|
20
|
+
|
21
|
+
def raw_info
|
22
|
+
@raw_info ||= JSON.parse(access_token.get(RAW_INFO_URL).response.body)
|
23
|
+
end
|
6
24
|
end
|
7
25
|
end
|
8
26
|
end
|