Module: Rhoconnect::Condition::LoginRequired

Included in:
Server
Defined in:
lib/rhoconnect/condition/login_required.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



6
7
8
# File 'lib/rhoconnect/condition/login_required.rb', line 6

def self.extended(base)
  base.
end

Instance Method Details

#include_login_required_conditionObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/rhoconnect/condition/login_required.rb', line 10

def 
  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