diff options
Diffstat (limited to 'auth')
-rw-r--r-- | auth/callback/index.php | 9 | ||||
-rw-r--r-- | auth/init/index.php | 2 |
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(); |