From 63708ccf1cb5bedef303af050130f52b34d7b6fa Mon Sep 17 00:00:00 2001 From: David Cristofaro Date: Tue, 18 Apr 2023 20:58:50 +1000 Subject: [PATCH] Fix basic auth --- config.ru | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.ru b/config.ru index 7268836..ec10716 100644 --- a/config.ru +++ b/config.ru @@ -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|