Skip to content

Instantly share code, notes, and snippets.

@Carpetfizz
Last active December 30, 2016 06:36
Show Gist options
  • Save Carpetfizz/fca10e44e4d7574205b14cc7abc87552 to your computer and use it in GitHub Desktop.
Save Carpetfizz/fca10e44e4d7574205b14cc7abc87552 to your computer and use it in GitHub Desktop.
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