omniauth-smaregi 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/omniauth/smaregi/version.rb +1 -1
- data/lib/omniauth/strategies/smaregi.rb +17 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7861ddad70f884e802c1b783735fc4aa90371395cef23e27bfc053ed363de5dc
|
4
|
+
data.tar.gz: a64848d32a57d603d3f33df7de454827873ea575387bcb5fa2a17272eb383447
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89223754f0080b62a1c50954d83b6bd9dad144fe5d54bb54cd83bad9e4cc63b7f898911c443d94a82e5bb8db6832fa52f51872122628885c498d3af38ebe691b
|
7
|
+
data.tar.gz: 1e93ce2b8ef6a9e4c496fa89d4ea9688b636e0d6569162575bf7aafca436938723cff9e2d2cab76cae92c54c824fe6f41ac89f205bf5e5266a430b7e628154ef
|
data/CHANGELOG.md
CHANGED
@@ -5,16 +5,21 @@ require "omniauth-oauth2"
|
|
5
5
|
module OmniAuth
|
6
6
|
module Strategies
|
7
7
|
class Smaregi < OmniAuth::Strategies::OAuth2
|
8
|
+
SANDBOX_SITE = "https://id.smaregi.dev"
|
9
|
+
SANDBOX_AUTHORIZE_URL = "https://id.smaregi.dev/authorize"
|
10
|
+
SANDBOX_TOKEN_URL = "https://id.smaregi.dev/authorize/token"
|
8
11
|
option :name, "smaregi"
|
9
12
|
|
10
13
|
option :client_options, {
|
11
|
-
site: "https://id.smaregi.
|
12
|
-
authorize_url: "https://id.smaregi.
|
13
|
-
token_url: "https://id.smaregi.
|
14
|
+
site: "https://id.smaregi.jp",
|
15
|
+
authorize_url: "https://id.smaregi.jp/authorize",
|
16
|
+
token_url: "https://id.smaregi.jp/authorize/token"
|
14
17
|
}
|
15
18
|
|
16
19
|
option :authorize_options, [:scope]
|
17
20
|
|
21
|
+
option :sandbox, false
|
22
|
+
|
18
23
|
uid { raw_info["contract"]["id"] }
|
19
24
|
|
20
25
|
info { raw_info }
|
@@ -27,6 +32,15 @@ module OmniAuth
|
|
27
32
|
full_host + script_name + callback_path
|
28
33
|
end
|
29
34
|
|
35
|
+
def setup_phase
|
36
|
+
if options.sandbox
|
37
|
+
options.client_options[:site] = SANDBOX_SITE
|
38
|
+
options.client_options[:authorize_url] = SANDBOX_AUTHORIZE_URL
|
39
|
+
options.client_options[:token_url] = SANDBOX_TOKEN_URL
|
40
|
+
end
|
41
|
+
super
|
42
|
+
end
|
43
|
+
|
30
44
|
def build_access_token
|
31
45
|
client.auth_code.get_token(
|
32
46
|
request.params["code"],
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-smaregi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ntakanashi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10
|
11
|
+
date: 2021-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|