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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1568ffb60fc57da744109b18ef4456e08c240c518986de67ede12c2541126625
|
|
4
|
+
data.tar.gz: 517d1c27ef80769a2085174c94b8187eeb1a80da7992bf24fd41b4c39c403c0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
#
|
|
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://
|
|
45
|
-
authorize_url: 'https://
|
|
46
|
-
token_url: 'https://
|
|
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:
|
|
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']
|
|
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']
|
|
84
|
-
business_name: raw_info['store_name']
|
|
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
|