omniauth-bike-index 1.0.1 → 1.0.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/bike_index/version.rb +1 -1
- data/lib/omniauth/strategies/bike_index.rb +15 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b9f71d1accda40fe004527d75fb4dcb27405778
|
4
|
+
data.tar.gz: 1b835a88e689729fb5373def5334bb764beccfc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4c05ea146dc05cafbd9ffd7f64016435123337765bd4717cc44b88e1247c8ee5b3fc6892af701c2f6e0391ba84a3c6a9a9872511e201cf6f3f9dd77e1486a09
|
7
|
+
data.tar.gz: f649544f7a5b0db02764fefb79193a6076bdff68e465e5ba0ac91120a808ba52f953152447489df677d4661824d412ebd8fa70086fef966b2b978606ab848d97
|
@@ -1,43 +1,43 @@
|
|
1
|
-
require
|
1
|
+
require "omniauth-oauth2"
|
2
2
|
|
3
3
|
module OmniAuth
|
4
4
|
module Strategies
|
5
5
|
class BikeIndex < OmniAuth::Strategies::OAuth2
|
6
6
|
option :name, :bike_index
|
7
|
-
DEFAULT_SCOPE =
|
8
|
-
option :client_options, site:
|
7
|
+
DEFAULT_SCOPE = "public"
|
8
|
+
option :client_options, site: "https://bikeindex.org", authorize_url: "/oauth/authorize"
|
9
9
|
|
10
|
-
uid { raw_info[
|
10
|
+
uid { raw_info["id"] }
|
11
11
|
|
12
12
|
info do
|
13
13
|
prune!(
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
"nickname" => raw_info["user"]["username"],
|
15
|
+
"bike_ids" => raw_info["bike_ids"],
|
16
|
+
"email" => raw_info["user"]["email"],
|
17
|
+
"name" => raw_info["user"]["name"],
|
18
|
+
"twitter" => raw_info["user"]["twitter"],
|
19
|
+
"image" => raw_info["user"]["image"],
|
20
20
|
)
|
21
21
|
end
|
22
22
|
|
23
23
|
extra do
|
24
24
|
hash = {}
|
25
|
-
hash[
|
25
|
+
hash["raw_info"] = raw_info unless skip_info?
|
26
26
|
prune! hash
|
27
27
|
end
|
28
28
|
|
29
29
|
def raw_info
|
30
|
-
@raw_info ||= access_token.get(
|
30
|
+
@raw_info ||= access_token.get("/api/v3/me").parsed || {}
|
31
31
|
end
|
32
32
|
|
33
33
|
def request_phase
|
34
|
-
options[:authorize_params] = { scope: (options[
|
34
|
+
options[:authorize_params] = { scope: (options["scope"] || DEFAULT_SCOPE), partner: options["partner"] }
|
35
35
|
super
|
36
36
|
end
|
37
37
|
|
38
38
|
# https://github.com/omniauth/omniauth-oauth2/issues/81
|
39
39
|
def callback_url
|
40
|
-
|
40
|
+
full_host + script_name + callback_path
|
41
41
|
end
|
42
42
|
|
43
43
|
private
|
@@ -50,4 +50,4 @@ module OmniAuth
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
53
|
-
end
|
53
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-bike-index
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Herr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|