diff options
author | RaindropsSys <contact@minteck.org> | 2023-05-13 19:25:44 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-05-13 19:25:44 +0200 |
commit | 21ed7d0e837d74c1ebd8ada4396f96ce42c14fb1 (patch) | |
tree | 8bdad11e806ad4ac6c68902eaf72913a4554e484 /pages/api/reauthenticate.php | |
parent | f80190dddaa72d9f8863b0b922e557668b6cba27 (diff) | |
download | pluralconnect-21ed7d0e837d74c1ebd8ada4396f96ce42c14fb1.tar.gz pluralconnect-21ed7d0e837d74c1ebd8ada4396f96ce42c14fb1.tar.bz2 pluralconnect-21ed7d0e837d74c1ebd8ada4396f96ce42c14fb1.zip |
Updated 14 files and added 6 files (automated)
Diffstat (limited to 'pages/api/reauthenticate.php')
-rw-r--r-- | pages/api/reauthenticate.php | 8 |
1 files changed, 7 insertions, 1 deletions
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 |