Created
September 12, 2014 18:50
-
-
Save davidpaulhunt/38dda6e0b585b59c2108 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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