omniauth-uber-eats-oauth2 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 92c7c2106c0598a632f71475bb890667c28a3154ae73c943c6ff627c95ca25c3
|
|
4
|
+
data.tar.gz: 6a71f29fdbd99ebbddc0834b2496fd43eeb6437e838ff9a1abe82e5792035002
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7711d536482ebe8e3be71dd6a76b4581030a50cfbf83ff4fdb7b3dbc6556cacb36d7e263fda172629fac559ef50f8fb6f78cf8e3aa70fd55ba1e919fabb21489
|
|
7
|
+
data.tar.gz: 8f01376dba12085075292cf62783a211d30ae9c71eeca7a98c921551b3f91275d147254ac4364c55cebbf782bd3e8b348e11f33b871a4a3d642849475ac0842c
|
|
@@ -38,6 +38,26 @@ module OmniAuth
|
|
|
38
38
|
|
|
39
39
|
option :sandbox, false
|
|
40
40
|
|
|
41
|
+
# Sandbox/production URL switching.
|
|
42
|
+
# When sandbox: true, all URLs point to Uber's sandbox environment.
|
|
43
|
+
SANDBOX_URLS = {
|
|
44
|
+
site: 'https://test-api.uber.com',
|
|
45
|
+
authorize_url: 'https://sandbox-login.uber.com/oauth/v2/authorize',
|
|
46
|
+
token_url: 'https://sandbox-login.uber.com/oauth/v2/token'
|
|
47
|
+
}.freeze
|
|
48
|
+
|
|
49
|
+
PRODUCTION_URLS = {
|
|
50
|
+
site: 'https://api.uber.com',
|
|
51
|
+
authorize_url: 'https://auth.uber.com/oauth/v2/authorize',
|
|
52
|
+
token_url: 'https://auth.uber.com/oauth/v2/token'
|
|
53
|
+
}.freeze
|
|
54
|
+
|
|
55
|
+
def setup_phase
|
|
56
|
+
super
|
|
57
|
+
urls = options.sandbox ? SANDBOX_URLS : PRODUCTION_URLS
|
|
58
|
+
options.client_options.merge!(urls)
|
|
59
|
+
end
|
|
60
|
+
|
|
41
61
|
# Override to strip query params from callback_url for redirect_uri matching.
|
|
42
62
|
def build_access_token
|
|
43
63
|
redirect_uri = callback_url.sub(/\?.*/, '')
|