Created
February 16, 2016 01:12
-
-
Save armandofox/69972ca0d08712661b34 to your computer and use it in GitHub Desktop.
omniauth_example.rb
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 SessionsController < ApplicationController | |
| def create | |
| @user = User.find_or_create_from_auth_hash(auth_hash) | |
| self.current_user = @user | |
| redirect_to '/' | |
| 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