Improved http error handling

This commit is contained in:
Michael 2021-10-29 23:21:07 +00:00
commit 4236a9a105
55 changed files with 277 additions and 130 deletions

View file

@ -246,8 +246,6 @@ function api_login(App $a)
if (!DBA::isResult($record)) {
Logger::debug(API_LOG_PREFIX . 'failed', ['module' => 'api', 'action' => 'login', 'parameters' => $_SERVER]);
header('WWW-Authenticate: Basic realm="Friendica"');
//header('HTTP/1.0 401 Unauthorized');
//die('This api requires login');
throw new UnauthorizedException("This API requires login");
}