summaryrefslogtreecommitdiff
path: root/pages/api/session.php
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-05-16 22:17:15 +0200
committerRaindropsSys <contact@minteck.org>2023-05-16 22:17:15 +0200
commit98a84f3aa735f31b08e807c8a4f0549742cbd1b0 (patch)
tree9a510d41197d6af646f1ee0bdbf261437211f1bc /pages/api/session.php
parent60f7da42c41b35b44fa397397a5e4bccd6039d45 (diff)
downloadpluralconnect-98a84f3aa735f31b08e807c8a4f0549742cbd1b0.tar.gz
pluralconnect-98a84f3aa735f31b08e807c8a4f0549742cbd1b0.tar.bz2
pluralconnect-98a84f3aa735f31b08e807c8a4f0549742cbd1b0.zip
Updated 8 files (automated)
Diffstat (limited to 'pages/api/session.php')
-rw-r--r--pages/api/session.php5
1 files changed, 3 insertions, 2 deletions
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