Enhance API error handling, add lastError tracking, and implement admin home template

This commit is contained in:
marc-go committed 2026-10-11 14:37:56 +02:00
1 parent ce0777bb33
commit 205f2e2f73
9 files changed
+257 -33

No files matched your search

+17 -4
View File
@@ -9,7 +9,20 @@ if (!isset($internal)) {
require_once API_DIR . "api.php";
$api = new gbAPI(true, $internal);
$api->answer(200, [
"login" => true,
"username" => $api->username
]);
$auth = $api->checkAuth();
$lastError = $api->returnLastError();
if ($lastError == NULL) {
if ($auth) {
$api->answer(200, [
"login" => true,
"username" => $api->username
]);
}else{
$api->answer(401, [
"login" => false,
"username" => ""
]);
}
}