2024-02-12 10:35:09 +08:00
|
|
|
<?php
|
2024-02-20 18:22:42 +08:00
|
|
|
include "functions.php";
|
2024-02-12 10:35:09 +08:00
|
|
|
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
|
|
$input = json_decode(file_get_contents('php://input'), true);
|
|
|
|
|
|
|
|
if (isset($input['token'])) {
|
|
|
|
// Update the session token
|
|
|
|
$_SESSION['token'] = $input['token'];
|
|
|
|
echo json_encode(['status' => 'success']);
|
|
|
|
} else {
|
|
|
|
echo json_encode(['status' => 'error', 'message' => 'Token not provided']);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
echo json_encode(['status' => 'error', 'message' => 'Invalid request method']);
|
|
|
|
}
|
|
|
|
?>
|