Sha256: 7792ebe9cea91f120f06bf3972ee4b7d5f18d00fe7d3bccad947df48a31ee5fa

Contents?: true

Size: 541 Bytes

Versions: 4

Compression:

Stored size: 541 Bytes

Contents

module KepplerFrontend
  class ApplicationController < App::AppController
    protect_from_forgery with: :exception
    before_action :user_signed_in?
    before_action :set_admin_locale

    def user_signed_in?
      return if current_user
      redirect_to '/alert/403'
    end

    def only_development
      redirect_to '/admin' if Rails.env.eql?('production')
    end

    def set_admin_locale
      if controller_path.include?('admin')
        I18n.locale = Appearance.first.language || I18n.default_locale
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
keppler-2.1.22 installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/application_controller.rb
keppler-2.1.21 installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/application_controller.rb
keppler-2.1.20 installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/application_controller.rb
keppler-2.1.19 installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/application_controller.rb