From 21ed7d0e837d74c1ebd8ada4396f96ce42c14fb1 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sat, 13 May 2023 19:25:44 +0200 Subject: Updated 14 files and added 6 files (automated) --- pages/api/reauthenticate.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pages/api/reauthenticate.php') diff --git a/pages/api/reauthenticate.php b/pages/api/reauthenticate.php index 50657cc..e726e8e 100644 --- a/pages/api/reauthenticate.php +++ b/pages/api/reauthenticate.php @@ -13,7 +13,13 @@ if (!$isLoggedIn || $isLowerLoggedIn) { $newToken = generateToken(); if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) { - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $newToken, file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $_COOKIE['PEH2_SESSION_TOKEN'])); + $old = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $_COOKIE['PEH2_SESSION_TOKEN']), true); + $old["name"] = base64_decode($_GET["name"] ?? "LQo="); + $old["created"] = time(); + $old["addresses"] = []; + $old["last"] = time(); + + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $newToken, json_encode($old)); } die($newToken); \ No newline at end of file -- cgit