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: 91669d6758878744840643e370d369fa246a8eeb400b9cdba988ea35ab9cb6a8
4
- data.tar.gz: 52fe483b8c95cdd011f070457a06f0a7a1c5704defbf5ed47dc48aa3a274cc36
3
+ metadata.gz: 92c7c2106c0598a632f71475bb890667c28a3154ae73c943c6ff627c95ca25c3
4
+ data.tar.gz: 6a71f29fdbd99ebbddc0834b2496fd43eeb6437e838ff9a1abe82e5792035002
5
5
  SHA512:
6
- metadata.gz: ae0ceebc7fca5fbbca32065cb9c57d653cf794ba874d267ad1d9df60e2bc7e2e444d7b056fe5e2c3d10013eae8a6c5ac86d08ab8445d510e4f3736e7da7b2163
7
- data.tar.gz: 2f88893066e0f750cc06a865c7a932a7b72aa881f929c137246d1aaec11c0a400dca2285341235326c0f9b03f18543436e6311241ffb2a7a6bff8a1321df0d6e
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(/\?.*/, '')
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module UberEatsOauth2
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-uber-eats-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dan1d