summaryrefslogtreecommitdiff
path: root/auth/callback
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-05-13 19:25:44 +0200
committerRaindropsSys <contact@minteck.org>2023-05-13 19:25:44 +0200
commit21ed7d0e837d74c1ebd8ada4396f96ce42c14fb1 (patch)
tree8bdad11e806ad4ac6c68902eaf72913a4554e484 /auth/callback
parentf80190dddaa72d9f8863b0b922e557668b6cba27 (diff)
downloadpluralconnect-21ed7d0e837d74c1ebd8ada4396f96ce42c14fb1.tar.gz
pluralconnect-21ed7d0e837d74c1ebd8ada4396f96ce42c14fb1.tar.bz2
pluralconnect-21ed7d0e837d74c1ebd8ada4396f96ce42c14fb1.zip
Updated 14 files and added 6 files (automated)
Diffstat (limited to 'auth/callback')
-rw-r--r--auth/callback/index.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/auth/callback/index.php b/auth/callback/index.php
index 4fa1eba..75d73ea 100644
--- a/auth/callback/index.php
+++ b/auth/callback/index.php
@@ -51,9 +51,21 @@ if (isset($result["access_token"])) {
$token = generateToken();
if (in_array($result["id"], $appdata["oauth"]["allowed"]["admin"])) {
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, json_encode($result));
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, json_encode([
+ "created" => time(),
+ "last" => time(),
+ "profile" => $result,
+ "addresses" => [],
+ "name" => "Cold Haze Web (" . get_browser(null, true)["browser"] . " on " . str_replace("Windows dows", "Windows", str_replace("Win", "Windows ", str_replace("MacOSX", "macOS", get_browser(null, true)["platform"]))) . ")"
+ ]));
} else {
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token, json_encode($result));
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token, json_encode([
+ "created" => time(),
+ "last" => time(),
+ "profile" => $result,
+ "addresses" => [],
+ "name" => "Cold Haze Web (" . get_browser(null, true)["browser"] . " on " . get_browser(null, true)["platform"] . ")"
+ ]));
}
header("Set-Cookie: PEH2_SESSION_TOKEN=" . $token . "; SameSite=None; Path=/; Secure; HttpOnly; Expires=" . date("r", time() + (86400 * 730)));