summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-05-12 16:43:04 +0200
committerRaindropsSys <contact@minteck.org>2023-05-12 16:43:04 +0200
commit0e4f6cea6a4f8d1f860ded405a66f9fca9d93d96 (patch)
treef8dcad460d9120442e23c8c567ba246eed39f71a /auth
parent761c84c0c17c04113608a20e8401270023741c7e (diff)
downloadpluralconnect-0e4f6cea6a4f8d1f860ded405a66f9fca9d93d96.tar.gz
pluralconnect-0e4f6cea6a4f8d1f860ded405a66f9fca9d93d96.tar.bz2
pluralconnect-0e4f6cea6a4f8d1f860ded405a66f9fca9d93d96.zip
Updated 5 files and added 29 files (automated)
Diffstat (limited to 'auth')
-rw-r--r--auth/callback/index.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/auth/callback/index.php b/auth/callback/index.php
index 40964b5..4fa1eba 100644
--- a/auth/callback/index.php
+++ b/auth/callback/index.php
@@ -1,5 +1,6 @@
<?php
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
$app = $GLOBALS["ColdHazeApp"] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
$server = "auth.equestria.horse";
@@ -47,7 +48,7 @@ if (isset($result["access_token"])) {
if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens");
if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens");
- $token = bin2hex(random_bytes(32));
+ $token = generateToken();
if (in_array($result["id"], $appdata["oauth"]["allowed"]["admin"])) {
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, json_encode($result));