Skip to content

Commit

Permalink
Fix basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcristo committed Apr 18, 2023
1 parent 02e3762 commit 63708cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ require 'net/http'

use Rack::Static, :root => 'public'

use Rack::Auth::Basic do |username, password|
ENV['HTTP_BASIC_AUTH_PASSWORD'].present? &&
username == 'user' &&
password == ENV['HTTP_BASIC_AUTH_PASSWORD']
unless ENV['HTTP_BASIC_AUTH_PASSWORD'].nil?
use Rack::Auth::Basic do |username, password|
username == 'user' && password == ENV['HTTP_BASIC_AUTH_PASSWORD']
end
end

app = lambda do |env|
Expand Down

0 comments on commit 63708cc

Please sign in to comment.