Class: SessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



3
4
5
6
7
# File 'app/controllers/sessions_controller.rb', line 3

def create
  user = User.from_omniauth(request.env['omniauth.auth'])
  session[:user_id] = user.id
  redirect_to Config.ui_root_url
end

#destroyObject



9
10
11
# File 'app/controllers/sessions_controller.rb', line 9

def destroy
  session[:user_id] = nil
end

#failureObject



13
14
15
# File 'app/controllers/sessions_controller.rb', line 13

def failure
  redirect_to Config.ui_root_url, failed: true
end