Sha256: 64d0455f0e9306e4e03a05f36f3ce23608dffbd712934fd1a4fb583854bbf952

Contents?: true

Size: 363 Bytes

Versions: 8

Compression:

Stored size: 363 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.new_user_session_path, alert: t('devise.failure.unauthenticated')
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
push_type_auth-0.9.5 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.9.3 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.9.2 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.9.1 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.9.0 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.9.0.beta.4 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.9.0.beta.3 app/controllers/concerns/push_type/authentication_methods.rb
push_type_auth-0.9.0.beta.2 app/controllers/concerns/push_type/authentication_methods.rb