Class: OmniAuth::Strategies::Pacreception

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

Constant Summary collapse

DEFAULT_SCOPE =

class NoAuthorizationCodeError < StandardError; en

'public'

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



37
38
39
40
41
42
43
44
45
46
# File 'lib/omniauth/strategies/pacreception.rb', line 37

def authorize_params
  super.tap do |params|
    %w[scope auth_type].each do |v|
            if request.params[v]
                params[v.to_sym] = request.params[v]
            end
    end
    params[:scope] ||= DEFAULT_SCOPE
  end
end

#callback_urlObject



48
49
50
# File 'lib/omniauth/strategies/pacreception.rb', line 48

def callback_url
  options[:callback_url] || super
end

#prune!(hash) ⇒ Object



52
53
54
55
56
57
# File 'lib/omniauth/strategies/pacreception.rb', line 52

def prune!(hash)
  hash.delete_if do |_, value|
    prune!(value) if value.is_a?(Hash)
    value.nil? || (value.respond_to?(:empty?) && value.empty?)
  end
end

#raw_infoObject



33
34
35
# File 'lib/omniauth/strategies/pacreception.rb', line 33

def raw_info
  @raw_info ||= access_token.get('/api/v1/me').parsed
end