Class: OmniAuth::Strategies::Dropbox

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth-dropbox2.rb

Instance Method Summary collapse

Instance Method Details

#callback_urlObject



40
41
42
43
44
# File 'lib/omniauth-dropbox2.rb', line 40

def callback_url
  # If redirect_uri is configured in token_params, use that
  # value.
  token_params.to_hash(symbolize_keys: true)[:redirect_uri] || super
end

#query_stringObject



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/omniauth-dropbox2.rb', line 46

def query_string
  # This method is called by callback_url, only if redirect_uri
  # is omitted in token_params.
  if request.params['code']
    # If this is a callback, ignore query parameters added by
    # the provider.
    ''
  else
    super
  end
end

#raw_infoObject



36
37
38
# File 'lib/omniauth-dropbox2.rb', line 36

def raw_info
  @raw_info ||= access_token.post('users/get_current_account', body: nil.to_json).parsed
end