Class: OmniAuth::Strategies::Wix
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Wix
- Defined in:
- lib/omniauth/strategies/wix.rb
Instance Method Summary collapse
Instance Method Details
#authorize_params ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/omniauth/strategies/wix.rb', line 32 def super.tap do |params| params["redirectUrl"] = callback_url params["appId"] = [:client_id] params["token"] = request.params["token"] end end |
#build_access_token ⇒ Object
44 45 46 47 48 |
# File 'lib/omniauth/strategies/wix.rb', line 44 def build_access_token verifier = request.params["code"] params = { :redirect_uri => callback_url }.merge(token_params.to_hash(:symbolize_keys => true).merge({ headers: { 'Content-Type' => 'application/json' } })) client.auth_code.get_token(verifier, params, deep_symbolize(.auth_token_params)) end |
#callback_url ⇒ Object
40 41 42 |
# File 'lib/omniauth/strategies/wix.rb', line 40 def callback_url full_host + script_name + callback_path end |
#client ⇒ Object
25 26 27 28 29 30 |
# File 'lib/omniauth/strategies/wix.rb', line 25 def client ::OAuth2::Client.new(.client_id, .client_secret, deep_symbolize(.)) do |b| b.request :json b.adapter Faraday.default_adapter end end |