diff --git a/lib/account.php b/lib/account.php index c27aef3..d9122b4 100644 --- a/lib/account.php +++ b/lib/account.php @@ -106,6 +106,7 @@ function doLogin($email, $password): array $loginCount = 0; $stmt->bind_result($uid, $first_name, $last_name, $nickname, $password_hash, $minecraft_nickname, $privilege_level, $lastLoginAt, $loginCount); $stmt->fetch(); + $stmt->close(); echo "user found"; if (password_verify($password, $password_hash)) { @@ -125,7 +126,6 @@ function doLogin($email, $password): array $_SESSION["email"] = $email; $_SESSION["minecraft_nickname"] = $minecraft_nickname; $_SESSION["privilege_level"] = $privilege_level; - $stmt->close(); } return $found ? ["Status" => "Success"] : ["Status" => "Fail"]; }