From 98a84f3aa735f31b08e807c8a4f0549742cbd1b0 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Tue, 16 May 2023 22:17:15 +0200 Subject: Updated 8 files (automated) --- pages/api/session.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pages/api/session.php') diff --git a/pages/api/session.php b/pages/api/session.php index f91288e..53e1845 100644 --- a/pages/api/session.php +++ b/pages/api/session.php @@ -14,11 +14,12 @@ if (!$isLoggedIn || $isLowerLoggedIn) { ], JSON_PRETTY_PRINT)); } -$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])), true); +global $token; +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)), true); die(json_encode([ "name" => $data["name"], "created" => date('c', $data["created"]), "last_seen" => date('c', $data["last"]), - "seen_at" => array_keys($data["addresses"]) + "seen_at" => array_keys($data["addresses"] ?? []) ], JSON_PRETTY_PRINT)); \ No newline at end of file -- cgit