summaryrefslogtreecommitdiff
path: root/Authentication
diff options
context:
space:
mode:
Diffstat (limited to 'Authentication')
-rw-r--r--Authentication/Callback/index.php4
-rw-r--r--Authentication/Mobile/index.php4
-rw-r--r--Authentication/Mobile2/index.php4
-rw-r--r--Authentication/Mobile2Callback/index.php (renamed from Authentication/MobileCallback/index.php)8
-rw-r--r--Authentication/Start/index.php2
-rw-r--r--Authentication/Username/index.php3
6 files changed, 13 insertions, 12 deletions
diff --git a/Authentication/Callback/index.php b/Authentication/Callback/index.php
index 0dad35d..9fa8ad4 100644
--- a/Authentication/Callback/index.php
+++ b/Authentication/Callback/index.php
@@ -9,7 +9,7 @@ if (!isset($_GET['code'])) {
$appdata = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Application.json"), true);
-$crl = curl_init('https://account.minteck.org/hub/api/rest/oauth2/token');
+$crl = curl_init('https://privateauth.equestria.dev/hub/api/rest/oauth2/token');
curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($crl, CURLINFO_HEADER_OUT, true);
curl_setopt($crl, CURLOPT_POST, true);
@@ -26,7 +26,7 @@ $result = json_decode($result, true);
curl_close($crl);
if (isset($result["access_token"])) {
- $crl = curl_init('https://account.minteck.org/hub/api/rest/users/me');
+ $crl = curl_init('https://privateauth.equestria.dev/hub/api/rest/users/me');
curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($crl, CURLINFO_HEADER_OUT, true);
curl_setopt($crl, CURLOPT_HTTPHEADER, [
diff --git a/Authentication/Mobile/index.php b/Authentication/Mobile/index.php
deleted file mode 100644
index 5811228..0000000
--- a/Authentication/Mobile/index.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-
-header("Location: https://account.minteck.org/hub/api/rest/oauth2/auth?client_id=" . json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Application.json"), true)["id"] . "&response_type=code&redirect_uri=http" . ($_SERVER['HTTPS'] ? "s" : "") . "://" . $_SERVER['HTTP_HOST'] . "/Authentication/MobileCallback&scope=Hub&request_credentials=default&access_type=offline");
-die();
diff --git a/Authentication/Mobile2/index.php b/Authentication/Mobile2/index.php
new file mode 100644
index 0000000..910df72
--- /dev/null
+++ b/Authentication/Mobile2/index.php
@@ -0,0 +1,4 @@
+<?php
+
+header("Location: https://privateauth.equestria.dev/hub/api/rest/oauth2/auth?client_id=" . json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Application.json"), true)["id"] . "&response_type=code&redirect_uri=http" . ($_SERVER['HTTPS'] ? "s" : "") . "://" . $_SERVER['HTTP_HOST'] . "/Authentication/Mobile2Callback&scope=Hub&request_credentials=default&access_type=offline");
+die(); \ No newline at end of file
diff --git a/Authentication/MobileCallback/index.php b/Authentication/Mobile2Callback/index.php
index 8c16d67..a59b926 100644
--- a/Authentication/MobileCallback/index.php
+++ b/Authentication/Mobile2Callback/index.php
@@ -9,7 +9,7 @@ if (!isset($_GET['code'])) {
$appdata = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Application.json"), true);
-$crl = curl_init('https://account.minteck.org/hub/api/rest/oauth2/token');
+$crl = curl_init('https://privateauth.equestria.dev/hub/api/rest/oauth2/token');
curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($crl, CURLINFO_HEADER_OUT, true);
curl_setopt($crl, CURLOPT_POST, true);
@@ -18,7 +18,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("http" . ($_SERVER['HTTPS'] ? "s" : "") . "://" . $_SERVER['HTTP_HOST'] . "/Authentication/MobileCallback") . "&code=" . $_GET['code']);
+curl_setopt($crl, CURLOPT_POSTFIELDS, "grant_type=authorization_code&redirect_uri=" . urlencode("http" . ($_SERVER['HTTPS'] ? "s" : "") . "://" . $_SERVER['HTTP_HOST'] . "/Authentication/Mobile2Callback") . "&code=" . $_GET['code']);
$result = curl_exec($crl);
$result = json_decode($result, true);
@@ -26,7 +26,7 @@ $result = json_decode($result, true);
curl_close($crl);
if (isset($result["access_token"])) {
- $crl = curl_init('https://account.minteck.org/hub/api/rest/users/me');
+ $crl = curl_init('https://privateauth.equestria.dev/hub/api/rest/users/me');
curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($crl, CURLINFO_HEADER_OUT, true);
curl_setopt($crl, CURLOPT_HTTPHEADER, [
@@ -54,7 +54,7 @@ if (isset($result["access_token"])) {
setcookie("BITS_SESSION_TOKEN", $token, 0, "/", "", true, true);
header("Set-Cookie: BITS_SESSION_TOKEN=" . $token . "; SameSite=None; Path=/; Secure; HttpOnly");
- header("Location: /Mobile");
+ header("Location: /Mobile2");
} else {
header("Location: /Authentication/Disallowed");
}
diff --git a/Authentication/Start/index.php b/Authentication/Start/index.php
index 006752e..c3e7685 100644
--- a/Authentication/Start/index.php
+++ b/Authentication/Start/index.php
@@ -1,4 +1,4 @@
<?php
-header("Location: https://account.minteck.org/hub/api/rest/oauth2/auth?client_id=" . json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Application.json"), true)["id"] . "&response_type=code&redirect_uri=http" . ($_SERVER['HTTPS'] ? "s" : "") . "://" . $_SERVER['HTTP_HOST'] . "/Authentication/Callback&scope=Hub&request_credentials=default&access_type=offline");
+header("Location: https://privateauth.equestria.dev/hub/api/rest/oauth2/auth?client_id=" . json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Application.json"), true)["id"] . "&response_type=code&redirect_uri=http" . ($_SERVER['HTTPS'] ? "s" : "") . "://" . $_SERVER['HTTP_HOST'] . "/Authentication/Callback&scope=Hub&request_credentials=default&access_type=offline");
die();
diff --git a/Authentication/Username/index.php b/Authentication/Username/index.php
index 63b4aed..9a84870 100644
--- a/Authentication/Username/index.php
+++ b/Authentication/Username/index.php
@@ -5,7 +5,8 @@ header("Content-Type: application/json");
$a = [
"name" => $_PROFILE["name"],
- "id" => $_PROFILE['id']
+ "id" => $_PROFILE['id'],
+ "system" => json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Systems.json"), true)[$_PROFILE['id']],
];
die(json_encode($a)); \ No newline at end of file