mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 01:55:21 +02:00
Improve logging and error handling (#3059)
* refactor: logging and errror handling
This commit is contained in:
parent
e21394d2d3
commit
ffbc107687
13 changed files with 143 additions and 93 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue