Class: OmniAuth::Strategies::Dailycred

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/dailycred.rb

Constant Summary collapse

AUTH_PARAMS =

allows parameters to be passed through

["action","identity_provider","referrer", "access_token"]

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



33
34
35
36
37
# File 'lib/omniauth/strategies/dailycred.rb', line 33

def authorize_params
  super.tap do |params|
    params[:state] ||= {}
  end
end

#old_request_phaseObject



30
# File 'lib/omniauth/strategies/dailycred.rb', line 30

alias :old_request_phase :request_phase

#request_phaseObject

this step allows auth_params to be added to the url



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/omniauth/strategies/dailycred.rb', line 40

def request_phase
  p session['omniauth.state']
  OmniAuth::Strategies::Dailycred::AUTH_PARAMS.each do |param|
    val = session['omniauth.params'][param]
    if val && !val.empty?
      options[:authorize_params] ||= {}
      options[:authorize_params].merge!(param => val)
    end
  end
  old_request_phase
end