Permalink
Browse files

fixed calls to oauth data

closes #2
  • Loading branch information...
Filip Tepper
Filip Tepper committed Dec 6, 2012
1 parent 9768578 commit e628c7c6d3123a1277a220541b30d9fd82b33586
Showing with 4 additions and 5 deletions.
  1. +4 −5 app/controllers/sessions_controller.rb
@@ -2,12 +2,11 @@
class SessionsController < ApplicationController
def create
- user = User.find_or_create_by(
- github_id: auth_hash['extra']['raw_info']['id'],
- username: auth_hash['extra']['raw_info']['login'],
- email: auth_hash['extra']['raw_info']['email']
+ self.current_user = User.find_or_create_by(
+ github_id: auth_hash.uid,
+ username: auth_hash.info['nickname'],
+ email: auth_hash.info['email']
)
- self.current_user = user
redirect_to orders_path, notice: "Bon appétit, #{current_user.username}!"
end

0 comments on commit e628c7c

Please sign in to comment.