Class: OmniAuth::Strategies::Delivery
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Delivery
- Defined in:
- lib/omniauth/strategies/delivery.rb
Constant Summary collapse
- DEFAULT_SCOPE =
"global"
- PRODUCTION_USER_SITE =
'https://laundryapi.delivery.com'
- PRODUCTION_API_SITE =
'https://api.delivery.com'
- DEVELOPMENT_USER_SITE =
'http://laundryqa.delivery.com'
- DEVELOPMENT_API_SITE =
'http://sandbox.delivery.com'
- @@mode =
:production
Instance Method Summary collapse
Instance Method Details
#auth_hash ⇒ Object
45 46 47 48 |
# File 'lib/omniauth/strategies/delivery.rb', line 45 def auth_hash OmniAuth::Utils.deep_merge(super, client_params.merge({ :grant_type => 'authorization_code'})) end |
#callback_phase ⇒ Object
50 51 52 53 |
# File 'lib/omniauth/strategies/delivery.rb', line 50 def callback_phase ..site = @@mode == :development ? DEVELOPMENT_API_SITE : PRODUCTION_API_SITE super end |
#raw_info ⇒ Object
55 56 57 58 59 60 |
# File 'lib/omniauth/strategies/delivery.rb', line 55 def raw_info access_token.[:mode] = :query access_token.[:param_name] = :token user_site = @@mode == :development ? DEVELOPMENT_USER_SITE : PRODUCTION_USER_SITE @raw_info ||= access_token.post(user_site + '/api/v1/customer/auth').parsed end |
#request_phase ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/omniauth/strategies/delivery.rb', line 37 def request_phase @@mode = :development if .include?(:development) [:authorize_options].delete(:development) ..site = @@mode == :development ? DEVELOPMENT_API_SITE : PRODUCTION_API_SITE [:authorize_params] = client_params.merge([:authorize_params]) super end |