summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
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));