Class: Omnitrack::SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Omnitrack::SessionsController
- Defined in:
- app/controllers/omnitrack/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/omnitrack/sessions_controller.rb', line 11 def create if valid_credentials? session[:omnitrack_admin_authenticated] = true redirect_to visit_events_path(locale: I18n.locale), notice: t("omnitrack.auth.login_success") else flash.now[:alert] = t("omnitrack.auth.login_failed") render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
21 22 23 24 |
# File 'app/controllers/omnitrack/sessions_controller.rb', line 21 def destroy session.delete(:omnitrack_admin_authenticated) redirect_to login_path(locale: I18n.locale), notice: t("omnitrack.auth.logout_success") end |
#new ⇒ Object
9 |
# File 'app/controllers/omnitrack/sessions_controller.rb', line 9 def new; end |