Sha256: 1e01bc6dd5881324c06aa59c0b81c70079c9c2e7fa2dd77fe7196bc46efc1259

Contents?: true

Size: 402 Bytes

Versions: 23

Compression:

Stored size: 402 Bytes

Contents

# frozen_string_literal: true

module Concerns
  module Authenticated
    extend ActiveSupport::Concern
    include Praxis::Callbacks

    included do
      before :action do |controller|
        auth_data = controller.request.headers['Authorization']
        Praxis::Responses::Unauthorized.new(body: 'Authentication info is invalid') if auth_data && auth_data !~ /secret/
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
praxis-2.0.0 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.40 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.39 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.38 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.37 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.36 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.35 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.34 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.33 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.32 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.31 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.30 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.29 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.28 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.27 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.26 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.25 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.24 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.23 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.22 spec/spec_app/app/concerns/authenticated.rb