Implement user authentication and registration; enhance error handling and database interaction in API

This commit is contained in:
marc-go committed 2026-10-04 19:21:38 +02:00
1 parent 2ac799d0a4
commit c50c1bd122
6 files changed
+163 -16

No files matched your search

+2 -1
View File
@@ -100,7 +100,8 @@
method: "POST",
body: JSON.stringify({
username: username,
password: password
password: password,
password_repeat: password_repeat
}),
headers: {
"Content-type": "application/json; charset=UTF-8"
+10 -3
View File
@@ -1,7 +1,14 @@
<?php
foreach($_SERVER as $key => $value) {
/*foreach($_SERVER as $key => $value) {
echo $key . " === " . $value . "<br>";
}
}*/
//echo $_SERVER["HTTP_X_API_KEY"];
//echo $_SERVER["HTTP_X_API_KEY"];
$string = '{"user":"marc", "auth":true}';
$secret = "281361f952279bd9530734c67ed04aed2756f0fe00cb998cd6c28324f491484c";
echo "Hash: " . hash_hmac("sha256", $string, $secret);
echo "Decode: " . hash_equals($string, $secret);