mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-30 21:30:14 +02:00
Improve logging and error handling (#3059)
* refactor: logging and errror handling
This commit is contained in:
@@ -20,7 +20,7 @@ final class AuthenticationMiddleware
|
||||
$password = $_SERVER['PHP_AUTH_PW'] ?? null;
|
||||
|
||||
if ($user === null || $password === null) {
|
||||
$this->renderAuthenticationDialog();
|
||||
print $this->renderAuthenticationDialog();
|
||||
exit;
|
||||
}
|
||||
if (
|
||||
@@ -29,14 +29,14 @@ final class AuthenticationMiddleware
|
||||
) {
|
||||
return;
|
||||
}
|
||||
$this->renderAuthenticationDialog();
|
||||
print $this->renderAuthenticationDialog();
|
||||
exit;
|
||||
}
|
||||
|
||||
private function renderAuthenticationDialog(): void
|
||||
private function renderAuthenticationDialog(): string
|
||||
{
|
||||
http_response_code(401);
|
||||
header('WWW-Authenticate: Basic realm="RSS-Bridge"');
|
||||
print render('error.html.php', ['message' => 'Please authenticate in order to access this instance !']);
|
||||
return render('access-denied.html.php');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user