Class: Clearance::SessionsController
Instance Method Summary
collapse
#show
#authorize, #deny_access
#authenticate, #current_user, #current_user=, #handle_unverified_request, #sign_in, #sign_out, #signed_in?, #signed_out?
Instance Method Details
#create ⇒ Object
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
sign_in @user
redirect_back_or url_after_create
end
end
|
#destroy ⇒ Object
17
18
19
20
|
# File 'app/controllers/clearance/sessions_controller.rb', line 17
def destroy
sign_out
redirect_to url_after_destroy
end
|
#new ⇒ Object
22
23
24
|
# File 'app/controllers/clearance/sessions_controller.rb', line 22
def new
render :template => 'sessions/new'
end
|