Class: Omnitrack::Path::SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Omnitrack::Path::SessionsController
- Defined in:
- app/controllers/omnitrack/path/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/omnitrack/path/sessions_controller.rb', line 12 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
22 23 24 25 |
# File 'app/controllers/omnitrack/path/sessions_controller.rb', line 22 def destroy session.delete(:omnitrack_admin_authenticated) redirect_to login_path(locale: I18n.locale), notice: t("omnitrack.auth.logout_success") end |
#new ⇒ Object
10 |
# File 'app/controllers/omnitrack/path/sessions_controller.rb', line 10 def new; end |