Sha256: f738977070f5450dc6412570c35ea11a73ca1f5cba82e31cef67f14ec013e2c6

Contents?: true

Size: 397 Bytes

Versions: 39

Compression:

Stored size: 397 Bytes

Contents

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

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
praxis-2.0.pre.18 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.17 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.16 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.15 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.14 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.13 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.12 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.11 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.10 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.9 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.8 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.7 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.6 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.5 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.4 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.3 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.2 spec/spec_app/app/concerns/authenticated.rb
praxis-2.0.pre.1 spec/spec_app/app/concerns/authenticated.rb
praxis-0.22.pre.2 spec/spec_app/app/concerns/authenticated.rb
praxis-0.22.pre.1 spec/spec_app/app/concerns/authenticated.rb