Class: OmniAuth::Strategies::Vis

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

Instance Method Summary collapse

Instance Method Details

#callback_urlObject

to fix always getting invalid_grant error see github.com/omniauth/omniauth-oauth2/issues/81#issuecomment-231442739



37
38
39
# File 'lib/omniauth/strategies/vis.rb', line 37

def callback_url
  full_host + script_name + callback_path
end

#on_path?(path) ⇒ Boolean



14
15
16
# File 'lib/omniauth/strategies/vis.rb', line 14

def on_path?(path)
  current_path.squeeze('/').casecmp(path.squeeze('/')).zero?
end

#raw_infoObject



41
42
43
# File 'lib/omniauth/strategies/vis.rb', line 41

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

#setup_phaseObject



18
19
20
21
22
23
24
25
# File 'lib/omniauth/strategies/vis.rb', line 18

def setup_phase
  # Authorize extra params
  authorized_params = [:locale, :confirm_identity, :allow_sign_up,
    :allowed_external_providers, :extra_agreement_title, :extra_agreement_text]
  authorized_params.each do |param|
    request.env['omniauth.strategy'].options[:authorize_params][param] = request.params[param.to_s]
  end
end