1
0
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:
Dag
2022-10-16 17:55:43 +02:00
committed by GitHub
parent e21394d2d3
commit ffbc107687
13 changed files with 143 additions and 93 deletions

View File

@@ -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');
}
}