From 445d3200ba29e9be9b2563b92616bda6399f0577 Mon Sep 17 00:00:00 2001 From: hitlerrip Date: Tue, 29 Jul 2025 20:27:10 +0200 Subject: proper auth added tokens and forced user to join a team on account creation, along with other minor changes --- backend/auth.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backend/auth.php') diff --git a/backend/auth.php b/backend/auth.php index cf646d8..36ddc86 100644 --- a/backend/auth.php +++ b/backend/auth.php @@ -25,7 +25,7 @@ elseif (!isset($wrkarr["password"]) || trim($wrkarr["password"]) == ""): die('{ "status": "password was not provided.\ncould not attempt to log in." }'); else: - $query = $pdo->prepare("SELECT name, password FROM users WHERE name LIKE ?"); + $query = $pdo->prepare("SELECT name, password, token, team FROM users WHERE name LIKE ?"); $query -> execute([$wrkarr["name"]]); $found = $query->fetch(PDO::FETCH_ASSOC); if ($found): @@ -34,7 +34,7 @@ else: die('{ "status": "wrong password." }'); else: - die('{ "status": "success" }'); + die("{ \"status\": \"success\", \"token\": \"$found[token]\", \"team\": \"$found[team]\" }"); endif; -- cgit v1.2.3