Class: Clearance::SessionsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#show

Methods included from Authorization

#authorize, #deny_access

Methods included from Authentication

#authenticate, #current_user, #current_user=, #handle_unverified_request, #sign_in, #sign_out, #signed_in?, #signed_out?

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/clearance/sessions_controller.rb', line 5

def create
  @user = authenticate(params)

  if @user.nil?
    flash_failure_after_create
    render :template => 'sessions/new', :status => :unauthorized
  else
     @user
    redirect_back_or url_after_create
  end
end

#destroyObject



17
18
19
20
# File 'app/controllers/clearance/sessions_controller.rb', line 17

def destroy
  sign_out
  redirect_to url_after_destroy
end

#newObject



22
23
24
# File 'app/controllers/clearance/sessions_controller.rb', line 22

def new
  render :template => 'sessions/new'
end