Add Database structure

This commit is contained in:
root committed 2026-10-05 10:52:31 +02:00
1 parent f5f42b73ee
commit 3ad5f5bdd6
4 files changed
+19 -4

No files matched your search

Regular → Executable
+2 -2
View File
@@ -28,14 +28,14 @@ $hash = hash("sha256", $password);
$command = "SELECT username, password FROM users WHERE username = :username AND password = :password";
$args = [
":username" => $username,
":password" => $password
":password" => $hash
];
// Execute SQL Command
$result = $api->dbCommand($command, true, true, $args);
// Check Result
if ($result) {
if ($result && password_verify($password, $result["password"])) {
// Login successful. Generate Auth Token
$token = $api->generateToken($username);
+2 -2
View File
@@ -2,7 +2,7 @@
// Load Main Libary
require "../api.php";
$api = new gbAPI(true);
$api = new gbAPI(false);
// Check Request body
if ($_SERVER["REQUEST_METHOD"] !== "POST") {
@@ -32,7 +32,7 @@ if ($password !== $password_repeat) {
}
// Hash Password
$hash = hash("sha256", $password);
$hash = password_hash($password);