omniauth-uber-eats-oauth2 0.2.0 → 0.2.2

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: 92c7c2106c0598a632f71475bb890667c28a3154ae73c943c6ff627c95ca25c3
4
- data.tar.gz: 6a71f29fdbd99ebbddc0834b2496fd43eeb6437e838ff9a1abe82e5792035002
3
+ metadata.gz: 1568ffb60fc57da744109b18ef4456e08c240c518986de67ede12c2541126625
4
+ data.tar.gz: 517d1c27ef80769a2085174c94b8187eeb1a80da7992bf24fd41b4c39c403c0b
5
5
  SHA512:
6
- metadata.gz: 7711d536482ebe8e3be71dd6a76b4581030a50cfbf83ff4fdb7b3dbc6556cacb36d7e263fda172629fac559ef50f8fb6f78cf8e3aa70fd55ba1e919fabb21489
7
- data.tar.gz: 8f01376dba12085075292cf62783a211d30ae9c71eeca7a98c921551b3f91275d147254ac4364c55cebbf782bd3e8b348e11f33b871a4a3d642849475ac0842c
6
+ metadata.gz: ba83c7c603fadf36a3d6f5454f969ae7345fd3a5cbb7b5368ad9c86df798515de40ff9727fa0d16620422f070fa82c0450922f5306456dc0684a784aceb5d7b9
7
+ data.tar.gz: b32ac1290334ee866a6bf9600178d07e112ea86f85197083a8db06421cc7cc886a5400a6a4d5dac4fdc220e20d1131cd20d71e643f96520a01f940650ba2b43e
@@ -39,11 +39,12 @@ module OmniAuth
39
39
  option :sandbox, false
40
40
 
41
41
  # Sandbox/production URL switching.
42
- # When sandbox: true, all URLs point to Uber's sandbox environment.
42
+ # OAuth always uses auth.uber.com regardless of environment.
43
+ # Only the API site differs: sandbox-api.uber.com vs api.uber.com.
43
44
  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'
45
+ site: 'https://sandbox-api.uber.com',
46
+ authorize_url: 'https://auth.uber.com/oauth/v2/authorize',
47
+ token_url: 'https://auth.uber.com/oauth/v2/token'
47
48
  }.freeze
48
49
 
49
50
  PRODUCTION_URLS = {
@@ -73,7 +74,10 @@ module OmniAuth
73
74
  raise
74
75
  end
75
76
 
76
- uid { raw_info['store_id'] || raw_info['id'] }
77
+ # UID: store_id from the stores API. Returns nil when no store found.
78
+ uid do
79
+ raw_info['store_id'] || raw_info['id']
80
+ end
77
81
 
78
82
  info do
79
83
  {
@@ -96,6 +100,7 @@ module OmniAuth
96
100
  def fetch_store_info
97
101
  response = access_token.get('/v1/eats/stores')
98
102
  parsed = response.parsed
103
+ log(:info, "Store info response: #{parsed.inspect}")
99
104
  stores = parsed['stores'] || []
100
105
  store = stores.first
101
106
 
@@ -107,10 +112,11 @@ module OmniAuth
107
112
  'status' => store['status']
108
113
  }
109
114
  else
115
+ log(:warn, "No stores found in response, using fallback UID")
110
116
  { 'store_id' => nil }
111
117
  end
112
118
  rescue StandardError => e
113
- log(:warn, "Failed to fetch store info: #{e.message}")
119
+ log(:warn, "Failed to fetch store info: #{e.message} — using fallback UID")
114
120
  { 'store_id' => nil }
115
121
  end
116
122
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module UberEatsOauth2
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.2'
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.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - dan1d