From 50b7b70a58942474790ac9c65ac58af87e90abb8 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 13 Apr 2022 09:13:01 +0200 Subject: Attempt 1 at fixing broken session --- oauth/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'oauth/index.php') diff --git a/oauth/index.php b/oauth/index.php index 0a6ce71..1ebf7b7 100755 --- a/oauth/index.php +++ b/oauth/index.php @@ -10,7 +10,7 @@ if (!isset($_GET['code'])) { $appdata = json_decode(file_get_contents("/mnt/familine/private/app.json"), true); -$crl = curl_init('https://' . $_CONFIG["Global"]["federation"]. '/auth/realms/Familine/protocol/openid-connect/token'); +$crl = curl_init('https://' . $_CONFIG["Global"]["federation"]. '/hub/api/rest/oauth2/token'); curl_setopt($crl, CURLOPT_RETURNTRANSFER, true); curl_setopt($crl, CURLINFO_HEADER_OUT, true); curl_setopt($crl, CURLOPT_POST, true); @@ -29,7 +29,7 @@ $result = json_decode($result, true); curl_close($crl); if (isset($result["access_token"])) { - $crl = curl_init('https://' . $_CONFIG["Global"]["federation"]. '/auth/realms/Familine/protocol/openid-connect/userinfo'); + $crl = curl_init('https://' . $_CONFIG["Global"]["federation"]. '/hub/api/rest/users/me'); curl_setopt($crl, CURLOPT_RETURNTRANSFER, true); curl_setopt($crl, CURLINFO_HEADER_OUT, true); curl_setopt($crl, CURLOPT_HTTPHEADER, [ @@ -49,5 +49,5 @@ if (isset($result["access_token"])) { file_put_contents("/mnt/familine/private/tokens/" . $token, json_encode($result)); setcookie("FL_SESSION_TOKEN", $token, 0, "/", "." . $_CONFIG["Global"]["cdn"], true, true); - header("Location: https://auth.familine.minteck.org/auth/realms/Familine/X-Familine-PersistentSession/?r=" . urlencode($_GET['r'])); + header("Location: " . $_GET['r']); } \ No newline at end of file -- cgit