class OmniAuth::Strategies::Universe

Constants

DEFAULT_GRANT
DEFAULT_RESPONSE_TYPE
INFO_URL

Public Instance Methods

authorize_params() click to toggle source

The OAuth2 client authorization parameters.

@return [OmniAuth::Strategy::Options]

Calls superclass method
# File lib/omniauth/strategies/universe.rb, line 36
def authorize_params
  super.tap do |params|
    params[:response_type] ||= DEFAULT_RESPONSE_TYPE
    params[:client_id] = client.id
  end
end
raw_info() click to toggle source

Unfiltered data about the authenticating user.

@return [Hash]

# File lib/omniauth/strategies/universe.rb, line 46
def raw_info
  @raw_info ||= access_token.get(INFO_URL).parsed['current_user'] || {}
end
token_params() click to toggle source

The OAuth2 client authentication parameters.

@return [OmniAuth::Strategy::Options]

Calls superclass method
# File lib/omniauth/strategies/universe.rb, line 53
def token_params
  super.tap do |params|
    params[:grant_type] ||= DEFAULT_GRANT
    params[:client_id] = client.id
    params[:client_secret] = client.secret
  end
end

Private Instance Methods

full_name() click to toggle source
# File lib/omniauth/strategies/universe.rb, line 63
def full_name
  first_name = raw_info['first_name'] || ''
  last_name = raw_info['last_name'] || ''

  "#{first_name} #{last_name}".strip || nil
end
prune!(hash) click to toggle source
# File lib/omniauth/strategies/universe.rb, line 70
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