Sha256: ee2a8b64bd5e0e0d3faeaa9103f72c9bf73557989386fe8e7ab86e82d21b0365

Contents?: true

Size: 748 Bytes

Versions: 16

Compression:

Stored size: 748 Bytes

Contents

Admin.controllers :sessions do

  get :new do
    render "/sessions/new", nil, :layout => false
  end

  post :create do
    if account = <%= options[:admin_model] %>.authenticate(params[:email], params[:password])
      set_current_account(account)
      redirect url(:base, :index)
    elsif Padrino.env == :development && params[:bypass]
      account = <%= options[:admin_model] %>.first
      set_current_account(account)
      redirect url(:base, :index)
    else
      params[:email], params[:password] = h(params[:email]), h(params[:password])
      flash[:warning] = "Login or password wrong."
      redirect url(:sessions, :new)
    end
  end

  delete :destroy do
    set_current_account(nil)
    redirect url(:sessions, :new)
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
bootstrap-on-0.0.9 lib/bootstrap-on/templates/app/controllers/sessions.rb.tt
bootstrap-on-0.0.8 lib/bootstrap-on/templates/app/controllers/sessions.rb.tt
bootstrap-on-0.0.7 lib/bootstrap-on/templates/app/controllers/sessions.rb.tt
bootstrap-on-0.0.6 lib/bootstrap-on/templates/app/controllers/sessions.rb.tt
bootstrap-on-0.0.5 lib/bootstrap-on/templates/app/controllers/sessions.rb.tt
bootstrap-on-0.0.4 lib/bootstrap-on/templates/app/controllers/sessions.rb.tt
bootstrap-on-0.0.3 lib/bootstrap-on/templates/app/controllers/sessions.rb.tt
bootstrap-on-0.0.2 lib/bootstrap-on/templates/app/controllers/sessions.rb.tt
bootstrap-on-0.0.1 lib/bootstrap-on/templates/app/controllers/sessions.rb.tt
bootstrap-on-0.0.0 lib/bootstrap-on/templates/app/controllers/sessions.rb.tt
lazy-head-gen-0.3.4 lib/lazy-head-gen/templates/admin_app/app/controllers/sessions.rb.tt
lazy-head-gen-0.3.3 lib/lazy-head-gen/templates/admin_app/app/controllers/sessions.rb.tt
lazy-head-gen-0.3.2 lib/lazy-head-gen/templates/admin_app/app/controllers/sessions.rb.tt
lazy-head-gen-0.3.1 lib/lazy-head-gen/templates/admin_app/app/controllers/sessions.rb.tt
lazy-head-gen-0.3.0 lib/lazy-head-gen/templates/admin_app/app/controllers/sessions.rb.tt
padrino-admin-0.10.6 lib/padrino-admin/generators/templates/app/controllers/sessions.rb.tt