Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- PagesCore::BaseController
- ApplicationController
- SessionsController
- Defined in:
- app/controllers/sessions_controller.rb
Instance Attribute Summary
Attributes included from PagesCore::Authentication
Instance Method Summary collapse
Methods included from PagesCore::StaticCacheController
Methods included from PagesCore::PoliciesHelper
#policy, #verify_policy, #verify_policy_with_proc
Methods included from PagesCore::ProcessTitler
inc_number_of_requests, original_title
Methods included from PagesCore::ErrorRenderer
Methods included from PagesCore::Authentication
#authenticate!, #deauthenticate!, #logged_in?
Instance Method Details
#create ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/sessions_controller.rb', line 4 def create user = find_user(params[:email], params[:password]) authenticate!(user) if user if logged_in? redirect_to admin_default_url else flash[:notice] = t("pages_core.invalid_login") redirect_to login_admin_users_url end end |
#destroy ⇒ Object
16 17 18 19 20 |
# File 'app/controllers/sessions_controller.rb', line 16 def destroy flash[:notice] = t("pages_core.logged_out") deauthenticate! redirect_to login_admin_users_url end |