1
0
Fork 0
dokkan-data-rails/app/controllers/sessions_controller.rb
2015-10-01 11:12:17 -04:00

18 lines
409 B
Ruby

class SessionsController < ApplicationController
def create
user = User.create_with_omniauth(env['omniauth.auth'])
session[:user_id] = user.id
redirect_to root_path, notice: 'You are now logged in'
end
def destroy
session[:user_id] = nil
redirect_to root_path, notice: 'You have been logged out'
end
def failure
redirect_to root_path, notice: 'Failed to login'
end
end