diff options
Diffstat (limited to 'auth/callback')
-rw-r--r-- | auth/callback/index.php | 16 |
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))); |