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
9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/trestle/auth/sessions_controller.rb', line 9 def create if user = Trestle.config.auth.authenticate(params) login!(user) remember_me! if params[:remember_me] == "1" redirect_to 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
20 21 22 23 |
# File 'app/controllers/trestle/auth/sessions_controller.rb', line 20 def destroy logout! redirect_to instance_exec(&Trestle.config.auth.redirect_on_logout) end |
#new ⇒ Object
6 7 |
# File 'app/controllers/trestle/auth/sessions_controller.rb', line 6 def new end |