Class: Yauth::FailureApp

Inherits:
Object
  • Object
show all
Defined in:
lib/yauth/failure_app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(realm = "Yauth secured area") ⇒ FailureApp

Returns a new instance of FailureApp.



5
6
7
# File 'lib/yauth/failure_app.rb', line 5

def initialize(realm="Yauth secured area")
  self.realm = realm
end

Instance Attribute Details

#realmObject

Returns the value of attribute realm.



3
4
5
# File 'lib/yauth/failure_app.rb', line 3

def realm
  @realm
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
# File 'lib/yauth/failure_app.rb', line 9

def call(env)
  [401, 
    { "Content-Type" => "text/plain", 
      "WWW-Authenticate" => %(Basic realm="#{realm}") }, 
    ["#{env['warden'].message}\n"]]
end