Class: Izanami::App
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Izanami::App
- Defined in:
- lib/izanami/app.rb
Class Method Summary collapse
-
.new ⇒ Object
Sinatra overrides =====================.
- .protect(app) ⇒ Object
Class Method Details
.new ⇒ Object
Sinatra overrides
165 166 167 |
# File 'lib/izanami/app.rb', line 165 def self.new(*) protect(super) end |
.protect(app) ⇒ Object
169 170 171 172 173 174 175 176 177 |
# File 'lib/izanami/app.rb', line 169 def self.protect(app) if ENV['IZANAMI_AUTH'].to_s.match(/disabled?/i) app else Rack::Auth::Basic.new(app) do |user, password| user == ENV['IZANAMI_USER'] && password == ENV['IZANAMI_PASSWORD'] end end end |