Sha256: b1832582b2e6499d5d2817c7f3280a08a531fc68cf103cc5a11f302aed3e7083

Contents?: true

Size: 470 Bytes

Versions: 6

Compression:

Stored size: 470 Bytes

Contents

module I18nline
  class ApplicationController < ActionController::Base
    before_action :check_authenticated_user

    private

      def check_authenticated_user
        unless(get_current_user and get_current_user.try(I18nline.can_translate_method))
          redirect_to I18nline::login_route, error: "You need to login first"
        end
      end

      def get_current_user
        I18nline.current_user ||= send I18nline.current_user_method
      end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
i18nline-0.0.15.alpha app/controllers/i18nline/application_controller.rb
i18nline-0.0.14.alpha app/controllers/i18nline/application_controller.rb
i18nline-0.0.12.alpha app/controllers/i18nline/application_controller.rb
i18nline-0.0.11.alpha app/controllers/i18nline/application_controller.rb
i18nline-0.0.10.alpha app/controllers/i18nline/application_controller.rb
i18nline-0.0.8.alpha app/controllers/i18nline/application_controller.rb