Class: Trestle::Auth::SessionsController

Inherits:
Trestle::ApplicationController
  • Object
show all
Defined in:
app/controllers/trestle/auth/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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.)
  else
    flash[:error] = t("admin.auth.error", default: "Incorrect login details.")
    redirect_to action: :new
  end
end

#destroyObject



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

#newObject



7
8
# File 'app/controllers/trestle/auth/sessions_controller.rb', line 7

def new
end