summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-18 11:34:36 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-18 11:34:36 +0100
commit9337aae8b1c87fad34884dacd5cd79d9591c60db (patch)
tree5340f9fa67cd6236e4c879f0057d51d0b1e21361 /auth
parent953ddd82e48dd206cef5ac94456549aed13b3ad5 (diff)
downloadpluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.gz
pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.bz2
pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.zip
Updated 39 files, added 86 files, deleted 40 files and renamed 2 files (automated)
Diffstat (limited to 'auth')
-rw-r--r--auth/callback/index.php9
-rw-r--r--auth/init/index.php2
2 files changed, 5 insertions, 6 deletions
diff --git a/auth/callback/index.php b/auth/callback/index.php
index 1ff53f7..9697e63 100644
--- a/auth/callback/index.php
+++ b/auth/callback/index.php
@@ -21,7 +21,7 @@ curl_setopt($crl, CURLOPT_HTTPHEADER, [
"Content-Type: application/x-www-form-urlencoded",
"Accept: application/json"
]);
-curl_setopt($crl, CURLOPT_POSTFIELDS, "grant_type=authorization_code&redirect_uri=" . urlencode("https://ponies.equestria.horse/auth/callback") . "&code=" . $_GET['code']);
+curl_setopt($crl, CURLOPT_POSTFIELDS, "grant_type=authorization_code&redirect_uri=" . urlencode("https://ponycule.equestria.horse/auth/callback") . "&code=" . $_GET['code']);
$result = curl_exec($crl);
$result = json_decode($result, true);
@@ -42,7 +42,6 @@ if (isset($result["access_token"])) {
if (!in_array($result["id"], $appdata["oauth"]["allowed"]["admin"]) && !in_array($result["id"], $appdata["oauth"]["allowed"]["lower"])) {
peh_error("Access denied, you are not allowed to login to this website", 403);
- die();
}
if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions");
@@ -57,17 +56,17 @@ if (isset($result["access_token"])) {
"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"]))) . ")"
+ "name" => "Ponycule 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"]))) . ")"
]));
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, $result_orig);
} else {
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/session/" . $token, json_encode([
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $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"] . ")"
+ "name" => "Ponycule Web (" . get_browser(null, true)["browser"] . " on " . get_browser(null, true)["platform"] . ")"
]));
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token, $result_orig);
diff --git a/auth/init/index.php b/auth/init/index.php
index 64535f4..d2f93ce 100644
--- a/auth/init/index.php
+++ b/auth/init/index.php
@@ -3,5 +3,5 @@
$app = $GLOBALS["ColdHazeApp"] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
$server = "account.equestria.dev";
-header("Location: https://$server/hub/api/rest/oauth2/auth?client_id=" . $GLOBALS["ColdHazeApp"]["oauth"]["id"] . "&response_type=code&redirect_uri=https://ponies.equestria.horse/auth/callback&scope=Hub&request_credentials=default&access_type=offline");
+header("Location: https://$server/hub/api/rest/oauth2/auth?client_id=" . $GLOBALS["ColdHazeApp"]["oauth"]["id"] . "&response_type=code&redirect_uri=https://ponycule.equestria.horse/auth/callback&scope=Hub&request_credentials=default&access_type=offline");
die();