Class: OmniAuth::Strategies::SmartHR

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

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



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

def authorize_params
  super.tap do |params|
    options[:authorize_options].each do |k|
      value = request.params[k.to_s]

      next if [nil, ""].include?(value)

      params[k] = value
    end

    session["omniauth.state"] = params[:state] if params[:state]
  end
end

#callback_urlObject



36
37
38
# File 'lib/omniauth/strategies/smarthr.rb', line 36

def callback_url
  options.redirect_uri || full_host + script_name + callback_path
end

#raw_infoObject



32
33
34
# File 'lib/omniauth/strategies/smarthr.rb', line 32

def raw_info
  @raw_info ||= access_token.get("/api/v1/users/me", headers: {}, parse: :json).parsed
end