Sha256: 7aa066963e6be0b07da72102095da4345756c529085423ff1021bb34059482c2
Contents?: true
Size: 680 Bytes
Versions: 14
Compression:
Stored size: 680 Bytes
Contents
class ExvoAuth::Strategies::Base < OmniAuth::Strategies::OAuth2 def initialize(app, name, app_id, app_secret, options = {}) options[:site] ||= ExvoAuth::Config.host super(app, name, app_id, app_secret, options) end def user_data @data ||= MultiJson.decode(@access_token.get('/user.json')) end def user_info { 'nickname' => user_data['nickname'], 'email' => user_data['email'] }.reject{ |k, v| v.nil? } end def auth_hash OmniAuth::Utils.deep_merge(super, { 'provider' => 'exvo', 'uid' => user_data['id'], 'user_info' => user_info, 'extra' => { 'user_hash' => user_data } }) end end
Version data entries
14 entries across 14 versions & 1 rubygems