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



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

#destroyObject



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

#newObject



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

def new
end