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) --- auth/callback/index.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'auth') 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))); -- cgit