lib/omniauth/strategies/paymium.rb in omniauth-paymium-1.0.9 vs lib/omniauth/strategies/paymium.rb in omniauth-paymium-1.0.10
- old
+ new
@@ -15,11 +15,11 @@
option :access_token_options, {
:mode => :query
}
option :authorize_params, {
- :scope => 'basic'
+ :scope => 'admin'
}
def build_access_token
token_params = {
:redirect_uri => callback_url.split('?').first,
@@ -28,30 +28,18 @@
}
verifier = request.params['code']
client.auth_code.get_token(verifier, token_params)
end
- uid { raw_info['name'] }
+ uid { admin_info['name'] }
info do
{
- 'email' => raw_info['email'],
- 'name' => raw_info['name']
+ 'email' => admin_info['email'],
+ 'name' => admin_info['name']
}
end
- admin_info do
- {
- 'email' => admin_info['email'],
- 'name' => admin_info['name']
- }
- end
-
-
- def raw_info
- access_token.options[:parse] = :json
- @raw_info ||= access_token.get("#{options.client_options.site}/api/v1/user").parsed
- end
def admin_info
access_token.options[:parse] = :json
@admin_info ||= access_token.get("#{options.client_options.site}/api/v1/admin").parsed
end