diff options
Diffstat (limited to 'lib/AuthenticationMiddleware.php')
-rw-r--r-- | lib/AuthenticationMiddleware.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AuthenticationMiddleware.php b/lib/AuthenticationMiddleware.php index 4c554a42..c77e1b91 100644 --- a/lib/AuthenticationMiddleware.php +++ b/lib/AuthenticationMiddleware.php @@ -14,6 +14,13 @@ final class AuthenticationMiddleware { + public function __construct() + { + if (Configuration::getConfig('authentication', 'password') === '') { + throw new \Exception('The authentication password cannot be the empty string'); + } + } + public function __invoke(): void { $user = $_SERVER['PHP_AUTH_USER'] ?? null; |