Enhance API error handling and response structure; update app name retrieval method
This commit is contained in:
1 parent
95f8e22f11
commit
eb67458ab1
9 files changed
+38
-9
No files matched your search
@@ -18,6 +18,7 @@ if (!isset($input["username"]) || !isset($input["password"]) || !isset($input["p
|
||||
"error" => "missing_fields",
|
||||
"error_text" => "Some fields are missing"
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if application already configurated
|
||||
@@ -26,6 +27,7 @@ if (is_file(APP_PATH . "database.db")) {
|
||||
"error" => "already_configurated",
|
||||
"error_text" => "The application is already configurated."
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check PDO drivers
|
||||
@@ -34,6 +36,7 @@ if (!extension_loaded("pdo_sqlite") || !extension_loaded("sqlite3")) {
|
||||
"error" => "missing_drives",
|
||||
"error_text" => "Please install the extensions pdo_sqlite and sqlite3."
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$username = $input["username"];
|
||||
@@ -46,6 +49,7 @@ if ($password !== $password_repeat) {
|
||||
"error" => "passwords_dont_match",
|
||||
"error_text" => "The passwords does not match."
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
// Hash Password
|
||||
|
||||
Reference in new issue
Block a user