Class: OmniAuth::Strategies::Workingnotworking

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

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject

To make the ‘state` param actually useful, encode any additional params on the request to /auth/workingnotworking into the `state` param sent to the provider.



56
57
58
59
60
61
62
63
64
65
# File 'lib/omniauth/strategies/workingnotworking.rb', line 56

def authorize_params
  options.authorize_params[:state] = SecureRandom.hex(24) + '|' + Base64.strict_encode64(request.params.to_param)
  params = options.authorize_params.merge(options_for("authorize"))
  if OmniAuth.config.test_mode
    @env ||= {}
    @env["rack.session"] ||= {}
  end
  session["omniauth.state"] = params[:state]
  params
end

#callback_urlObject



73
74
75
# File 'lib/omniauth/strategies/workingnotworking.rb', line 73

def callback_url
  full_host + script_name + callback_path
end

#raw_infoObject



67
68
69
70
71
# File 'lib/omniauth/strategies/workingnotworking.rb', line 67

def raw_info
  @raw_info ||= access_token.get('/api/v1/account').parsed
rescue ::Errno::ETIMEDOUT
  raise ::Timeout::Error
end