omniauth-uber-eats-oauth2 0.2.1 → 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: cea19e4b210768c9b76023ad072499cfb20e97e46797f8a7ef2b7caec39dfe25
4
- data.tar.gz: 308a306de3280c6eed9f0f75eca1919fa9bdbc6d426f7bb4b398ebf4146fcd18
3
+ metadata.gz: 1568ffb60fc57da744109b18ef4456e08c240c518986de67ede12c2541126625
4
+ data.tar.gz: 517d1c27ef80769a2085174c94b8187eeb1a80da7992bf24fd41b4c39c403c0b
5
5
  SHA512:
6
- metadata.gz: 7350e7c0c56a3786c6743afbc75be6b186a83e2fd74f27e7c1a5bbd474ed44a2ca35335f5d31eeef204d9370589c3bf70994378c1ea3282754c6b6c4f5d487e4
7
- data.tar.gz: 6805ee5e9e3d1e9adf72f3db8c8a9ba19e4fe2aecd812f344beba03591dc12f6db5304b0e0ef9f463a3b8274f586fbc23810e6e897031c4c5e028f6dc49bc003
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,15 +74,15 @@ module OmniAuth
73
74
  raise
74
75
  end
75
76
 
76
- # UID: prefer store_id from API, fall back to uber_user_id from token
77
+ # UID: store_id from the stores API. Returns nil when no store found.
77
78
  uid do
78
- raw_info['store_id'] || raw_info['id'] || uber_user_id
79
+ raw_info['store_id'] || raw_info['id']
79
80
  end
80
81
 
81
82
  info do
82
83
  {
83
- name: raw_info['store_name'] || "Uber Eats Store",
84
- business_name: raw_info['store_name'] || "Uber Eats Store",
84
+ name: raw_info['store_name'],
85
+ business_name: raw_info['store_name'],
85
86
  email: nil # Uber Eats doesn't provide merchant email via API
86
87
  }
87
88
  end
@@ -96,16 +97,6 @@ module OmniAuth
96
97
 
97
98
  private
98
99
 
99
- # Extract user ID from the access token response.
100
- # Uber's token response includes uber_user_id or we can derive from token params.
101
- def uber_user_id
102
- return @uber_user_id if defined?(@uber_user_id)
103
-
104
- @uber_user_id = access_token.params['uber_user_id'] ||
105
- access_token.params['user_id'] ||
106
- access_token.token&.first(32) # last resort: use token prefix as stable ID
107
- end
108
-
109
100
  def fetch_store_info
110
101
  response = access_token.get('/v1/eats/stores')
111
102
  parsed = response.parsed
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module UberEatsOauth2
5
- VERSION = '0.2.1'
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.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - dan1d