Class: Authenticate::SessionsController
- Inherits:
-
AuthenticateController
- Object
- ApplicationController
- AuthenticateController
- Authenticate::SessionsController
- Defined in:
- app/controllers/authenticate/sessions_controller.rb
Overview
Allow authenticate users to log in and log out.
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/authenticate/sessions_controller.rb', line 12 def create @user = authenticate(params) login(@user) do |status| if status.success? redirect_back_or url_after_create else flash.now.notice = status. render template: 'sessions/new', status: :unauthorized end end end |
#destroy ⇒ Object
24 25 26 27 |
# File 'app/controllers/authenticate/sessions_controller.rb', line 24 def destroy logout redirect_to url_after_destroy end |
#new ⇒ Object
8 9 10 |
# File 'app/controllers/authenticate/sessions_controller.rb', line 8 def new render template: 'sessions/new' end |