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:
|
|
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,7 +74,10 @@ module OmniAuth
|
|
|
73
74
|
raise
|
|
74
75
|
end
|
|
75
76
|
|
|
76
|
-
|
|
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
|
|