Sha256: a243d1bbed48e2a7513089c3503e88942c5a82dc8762f825b3914ae3ecb1b7fc

Contents?: true

Size: 556 Bytes

Versions: 23

Compression:

Stored size: 556 Bytes

Contents

require 'rhoconnect/middleware/helpers'

module Rhoconnect
  module Condition
    module LoginRequired
      def self.extended(base)
        base.include_login_required_condition
      end

      def include_login_required_condition
        set(:login_required) do |value|
          #puts "lgin kls is #{self.to_s}"
          condition do
            if value
              throw :halt, [401, {'Content-Type' => 'text/plain'}, "Not authenticated"] if @env[Rhoconnect::CURRENT_USER].nil?
            end
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 lib/rhoconnect/condition/login_required.rb
rhoconnect-7.5.1 lib/rhoconnect/condition/login_required.rb
rhoconnect-7.4.1 lib/rhoconnect/condition/login_required.rb
rhoconnect-7.1.17 lib/rhoconnect/condition/login_required.rb
rhoconnect-6.2.0 lib/rhoconnect/condition/login_required.rb
rhoconnect-6.0.11 lib/rhoconnect/condition/login_required.rb
rhoconnect-5.5.18 lib/rhoconnect/condition/login_required.rb
rhoconnect-5.5.17 lib/rhoconnect/condition/login_required.rb
rhoconnect-5.5.15 lib/rhoconnect/condition/login_required.rb
rhoconnect-5.5.0.22 lib/rhoconnect/condition/login_required.rb
rhoconnect-5.5.2 lib/rhoconnect/condition/login_required.rb
rhoconnect-5.5.0.7 lib/rhoconnect/condition/login_required.rb
rhoconnect-5.5.0.3 lib/rhoconnect/condition/login_required.rb
rhoconnect-5.5.0 lib/rhoconnect/condition/login_required.rb
rhoconnect-5.1.1 lib/rhoconnect/condition/login_required.rb
rhoconnect-4.0.4 lib/rhoconnect/condition/login_required.rb
rhoconnect-4.0.3 lib/rhoconnect/condition/login_required.rb
rhoconnect-4.0.2 lib/rhoconnect/condition/login_required.rb
rhoconnect-4.0.1 lib/rhoconnect/condition/login_required.rb
rhoconnect-4.0.0 lib/rhoconnect/condition/login_required.rb