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