Sha256: 14a810f6a723c1574276a42608ab9765007b165d5bf2c8f7177977a5af15b7ba

Contents?: true

Size: 369 Bytes

Versions: 14

Compression:

Stored size: 369 Bytes

Contents

module PushType
  module AuthenticationMethods
    extend ActiveSupport::Concern

    included do
      before_action :authenticate_user!
    end

    protected

    def authenticate_user!
      if user_signed_in?
        super
      else
        redirect_to push_type_admin.new_user_session_path, alert: t('devise.failure.unauthenticated')
      end
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
push_type_auth-0.12.1 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.12.0 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.12.0.beta.1 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.11.2 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.11.1 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.11.0.beta.2 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.11.0.beta.1 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.10.4 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.10.3 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.10.2 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.10.1 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.10.0 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.10.0.beta.5 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.10.0.beta.3 app/controllers/concerns/push_type/authentication_methods.rb