summaryrefslogtreecommitdiff
path: root/oauth
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-29 22:27:20 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-29 22:27:20 +0100
commit747d8f88d5a635ba68b3f6288fb8d1f3fe48f83d (patch)
tree66101947d417a29099b1be462ec3029a7a092657 /oauth
parent6f6a92041aae1577a963af9c3a31b46950e15f40 (diff)
downloadmist-747d8f88d5a635ba68b3f6288fb8d1f3fe48f83d.tar.gz
mist-747d8f88d5a635ba68b3f6288fb8d1f3fe48f83d.tar.bz2
mist-747d8f88d5a635ba68b3f6288fb8d1f3fe48f83d.zip
Updated 19 files, added 5 files and deleted app/studio.php (automated)
Diffstat (limited to 'oauth')
-rw-r--r--oauth/.DS_Storebin6148 -> 6148 bytes
-rw-r--r--oauth/callback/index.php2
-rw-r--r--oauth/init/index.php2
3 files changed, 2 insertions, 2 deletions
diff --git a/oauth/.DS_Store b/oauth/.DS_Store
index 2a12673..e14fa9f 100644
--- a/oauth/.DS_Store
+++ b/oauth/.DS_Store
Binary files differ
diff --git a/oauth/callback/index.php b/oauth/callback/index.php
index bbb3322..bb3f57f 100644
--- a/oauth/callback/index.php
+++ b/oauth/callback/index.php
@@ -19,7 +19,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(($_SERVER['SERVER_PORT'] === "8043" ? "https://mist-testing.equestria.horse" : "https://mist.equestria.horse") . "/oauth/callback") . "&code=" . $_GET['code']);
+curl_setopt($crl, CURLOPT_POSTFIELDS, "grant_type=authorization_code&redirect_uri=" . urlencode(($_SERVER['HTTP_HOST'] === "mist-testing.equestria.horse" ? "https://mist-testing.equestria.horse" : "https://mist.equestria.horse") . "/oauth/callback") . "&code=" . $_GET['code']);
$result = curl_exec($crl);
$result = json_decode($result, true);
diff --git a/oauth/init/index.php b/oauth/init/index.php
index f0696b2..4f2be05 100644
--- a/oauth/init/index.php
+++ b/oauth/init/index.php
@@ -4,5 +4,5 @@ header("X-Frame-Options: DENY");
$app = 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=" . $app["id"] . "&response_type=code&redirect_uri=" . ($_SERVER['SERVER_PORT'] === "8043" ? "https://mist-testing.equestria.horse" : "https://mist.equestria.horse") . "/oauth/callback&scope=Hub&request_credentials=default&access_type=offline");
+header("Location: https://$server/hub/api/rest/oauth2/auth?client_id=" . $app["id"] . "&response_type=code&redirect_uri=" . ($_SERVER['HTTP_HOST'] === "mist-testing.equestria.horse" ? "https://mist-testing.equestria.horse" : "https://mist.equestria.horse") . "/oauth/callback&scope=Hub&request_credentials=default&access_type=offline");
die();