Permalink
Browse files

services_controller#create updated to use new omniauth schema.

  • Loading branch information...
1 parent 448429b commit b7f790fa55b50ecf936d62b35690655b2247d8ce @yorch yorch committed Jun 23, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 app/controllers/services_controller.rb
@@ -79,18 +79,18 @@ def create
@authhash = Hash.new
if service_route == 'facebook'
- omniauth['extra']['user_hash']['email'] ? @authhash[:email] = omniauth['extra']['user_hash']['email'] : @authhash[:email] = ''
- omniauth['extra']['user_hash']['name'] ? @authhash[:name] = omniauth['extra']['user_hash']['name'] : @authhash[:name] = ''
- omniauth['extra']['user_hash']['id'] ? @authhash[:uid] = omniauth['extra']['user_hash']['id'].to_s : @authhash[:uid] = ''
+ omniauth['extra']['raw_info']['email'] ? @authhash[:email] = omniauth['extra']['raw_info']['email'] : @authhash[:email] = ''
+ omniauth['extra']['raw_info']['name'] ? @authhash[:name] = omniauth['extra']['raw_info']['name'] : @authhash[:name] = ''
+ omniauth['extra']['raw_info']['id'] ? @authhash[:uid] = omniauth['extra']['raw_info']['id'].to_s : @authhash[:uid] = ''
omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''
elsif service_route == 'github'
- omniauth['user_info']['email'] ? @authhash[:email] = omniauth['user_info']['email'] : @authhash[:email] = ''
- omniauth['user_info']['name'] ? @authhash[:name] = omniauth['user_info']['name'] : @authhash[:name] = ''
- omniauth['extra']['user_hash']['id'] ? @authhash[:uid] = omniauth['extra']['user_hash']['id'].to_s : @authhash[:uid] = ''
+ omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''
+ omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''
+ omniauth['extra']['raw_info']['id'] ? @authhash[:uid] = omniauth['extra']['raw_info']['id'].to_s : @authhash[:uid] = ''
omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''
elsif ['google', 'yahoo', 'twitter', 'myopenid', 'open_id'].index(service_route) != nil
- omniauth['user_info']['email'] ? @authhash[:email] = omniauth['user_info']['email'] : @authhash[:email] = ''
- omniauth['user_info']['name'] ? @authhash[:name] = omniauth['user_info']['name'] : @authhash[:name] = ''
+ omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''
+ omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''
omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''
omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''
else

0 comments on commit b7f790f

Please sign in to comment.