class OmniAuth::Strategies::Tiktok

Constants

DEFAULT_SCOPE
USER_INFO_URL

Public Instance Methods

authorize_params() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/tiktok.rb, line 60
def authorize_params
  super.tap do |params|
    params[:scope] ||= DEFAULT_SCOPE
    params[:response_type] = 'code'
    params.delete(:client_id)
    params[:client_key] = options.client_id
  end
end
callback_url() click to toggle source
# File lib/omniauth/strategies/tiktok.rb, line 56
def callback_url
  options[:callback_url] || (full_host + script_name + callback_path)
end
raw_info() click to toggle source
# File lib/omniauth/strategies/tiktok.rb, line 50
def raw_info
  @raw_info ||= access_token
                .get("#{USER_INFO_URL}?open_id=#{access_token.params['open_id']}&access_token=#{access_token.token}")
                .parsed || {}
end
token_params() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/tiktok.rb, line 69
def token_params
  super.tap do |params|
    params.delete(:client_id)
    params[:client_key] = options.client_id
  end
end

Private Instance Methods

prune!(hash) click to toggle source
# File lib/omniauth/strategies/tiktok.rb, line 78
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