1
0
Fork 0
dokkan-data-rails/app/controllers/sessions_controller.rb

19 lines
409 B
Ruby
Raw Permalink Normal View History

2015-09-29 21:21:05 -04:00
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