bearer middleware

This commit is contained in:
2024-10-22 11:09:35 +03:00
parent 215d2b1290
commit 7ccf0957bf
14 changed files with 141 additions and 9 deletions

View File

@ -101,6 +101,12 @@ class RestController
$this->renderApi($model->toArray());
}
#[NoReturn] public function returnError(int $code): void
{
http_response_code($code);
die('Forbidden');
}
#[NoReturn] protected function renderApi(array $data): void
{
header("Content-Type: application/json");
@ -108,4 +114,6 @@ class RestController
exit();
}
}