debug print

This commit is contained in:
Bruno Rybársky 2024-02-03 17:10:54 +01:00
parent 0b7a8c0252
commit e37bfdd291
2 changed files with 3 additions and 2 deletions

@ -4,6 +4,7 @@ require_once "lib/account.php";
function endpoint($endpoint_data): array function endpoint($endpoint_data): array
{ {
print_r($endpoint_data);
return match ($endpoint_data["action"]) { return match ($endpoint_data["action"]) {
//not logged in start //not logged in start

@ -83,7 +83,7 @@ function verifyPassword($userID, $password): bool
$stmt->fetch(); $stmt->fetch();
$stmt->close(); $stmt->close();
return !empty($password_hash) && password_verify($password, $password_hash); return !empty($password_hash) && !empty($password) && password_verify($password, $password_hash);
} }
function doLogin($email, $password): array function doLogin($email, $password): array
@ -108,7 +108,7 @@ function doLogin($email, $password): array
if ($stmt->num_rows() > 0) { if ($stmt->num_rows() > 0) {
$stmt->fetch(); $stmt->fetch();
if (password_verify($password, $password_hash) && $privilege_level >= $routerConfig["logged_in_default_permission_level"]) { if (password_verify($password, $password_hash)) {
$found = true; $found = true;
// Update LastLoginAt and LoginCount // Update LastLoginAt and LoginCount