aboutsummaryrefslogtreecommitdiff
path: root/backend/auth.php
diff options
context:
space:
mode:
authorhitlerrip <git@hitler.rip>2025-07-29 20:27:10 +0200
committerhitlerrip <git@hitler.rip>2025-07-29 20:27:10 +0200
commit445d3200ba29e9be9b2563b92616bda6399f0577 (patch)
tree802a50012c74e454059e7171079ee5194239a869 /backend/auth.php
parent551b95fa58bf62b4a0780e09b9cba434eae52786 (diff)
downloadhitler-clicker-445d3200ba29e9be9b2563b92616bda6399f0577.tar.gz
hitler-clicker-445d3200ba29e9be9b2563b92616bda6399f0577.tar.bz2
hitler-clicker-445d3200ba29e9be9b2563b92616bda6399f0577.zip
proper auth
added tokens and forced user to join a team on account creation, along with other minor changes
Diffstat (limited to 'backend/auth.php')
-rw-r--r--backend/auth.php4
1 files changed, 2 insertions, 2 deletions
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;