Class: OmniAuth::Strategies::Neteasy

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

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject

You can pass display, with_offical_account or state params to the auth request, if you need to set them dynamically. You can also set these options in the OmniAuth config :authorize_params option.



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/omniauth/strategies/neteasy.rb', line 50

def authorize_params
  super.tap do |params|
    %w[display state].each do |v|
      if request.params[v]
        params[v.to_sym] = request.params[v]

        # to support omniauth-oauth2's auto csrf protection
        session['omniauth.state'] = params[:state] if v == 'state'
      end
    end
  end
end

#raw_infoObject



39
40
41
42
43
# File 'lib/omniauth/strategies/neteasy.rb', line 39

def raw_info
  access_token.options[:mode] = :query
  access_token.options[:param_name] = 'access_token'
  @raw_info ||= access_token.get("/users/show.json").parsed
end