File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ class Ecwid < OmniAuth::Strategies::OAuth2
77 option :name , "ecwid"
88 option :client_options , {
99 :site => 'https://my.ecwid.com' ,
10- :authorize_url => '/api/oauth/authorize' ,
11- :token_url => '/api/oauth/token'
10+ :authorize_url => '/api/oauth/authorize'
1211 }
1312
1413 # scope: "read_orders update_catalog", etc
@@ -18,6 +17,15 @@ class Ecwid < OmniAuth::Strategies::OAuth2
1817 uid {
1918 access_token . params . fetch ( "store_id" )
2019 }
20+
21+ protected
22+
23+ # Override to set token_url with store_id from callback params
24+ def build_access_token
25+ store_id = request . params [ 'store_id' ]
26+ options . client_options [ :token_url ] = "/api/oauth/token/#{ store_id } "
27+ super
28+ end
2129 end
2230 end
2331end
You can’t perform that action at this time.
0 commit comments