Last active
December 30, 2016 06:36
-
-
Save Carpetfizz/fca10e44e4d7574205b14cc7abc87552 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 SessionsController < ApplicationController | |
def create | |
@user = User.find_or_create_from_auth_hash(env["omniauth.auth"]) | |
session[:user_id] = @user.id | |
redirect_to :me | |
end | |
def destroy | |
session[:user_id] = nil | |
redirect_to root_path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment