Skip to content

Instantly share code, notes, and snippets.

@davidpaulhunt
Created September 12, 2014 18:50
Show Gist options
  • Select an option

  • Save davidpaulhunt/38dda6e0b585b59c2108 to your computer and use it in GitHub Desktop.

Select an option

Save davidpaulhunt/38dda6e0b585b59c2108 to your computer and use it in GitHub Desktop.
class AuthController < ApplicationController
def facebook
@user = User.find_or_create_from_auth_hash(auth_hash)
self.current_user = @user
end
def facebook_callback
current_user.set_facebook_token(auth_hash.credentials.token)
redirect_to wishlists_path, notice: "Facebook hooked up!"
end
protected
def auth_hash
request.env['omniauth.auth']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment