Class: Trestle::Auth::SessionsController
- Inherits:
-
Trestle::ApplicationController
- Object
- Trestle::ApplicationController
- Trestle::Auth::SessionsController
- Defined in:
- app/controllers/trestle/auth/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/controllers/trestle/auth/sessions_controller.rb', line 10 def create if authentication_backend.authenticate! redirect_to authentication_backend.previous_location || instance_exec(&Trestle.config.auth.redirect_on_login) else flash[:error] = t("admin.auth.error", default: "Incorrect login details.") redirect_to action: :new end end |
#destroy ⇒ Object
19 20 21 22 |
# File 'app/controllers/trestle/auth/sessions_controller.rb', line 19 def destroy logout! redirect_to instance_exec(&Trestle.config.auth.redirect_on_logout) end |
#new ⇒ Object
7 8 |
# File 'app/controllers/trestle/auth/sessions_controller.rb', line 7 def new end |