diff options
author | Minteck <contact@minteck.org> | 2022-04-13 09:19:20 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-04-13 09:19:20 +0200 |
commit | 026165618d2cbd72333d52ec9809e09d10961e58 (patch) | |
tree | 1a8649cde4a6c77cf1775c50ab8c62e02ff26143 /oauth | |
parent | 50b7b70a58942474790ac9c65ac58af87e90abb8 (diff) | |
download | session-026165618d2cbd72333d52ec9809e09d10961e58.tar.gz session-026165618d2cbd72333d52ec9809e09d10961e58.tar.bz2 session-026165618d2cbd72333d52ec9809e09d10961e58.zip |
Attempt 2 at fixing broken session
Diffstat (limited to 'oauth')
-rwxr-xr-x | oauth/index.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/oauth/index.php b/oauth/index.php index 1ebf7b7..6c6447f 100755 --- a/oauth/index.php +++ b/oauth/index.php @@ -47,7 +47,13 @@ if (isset($result["access_token"])) { $result["name"] = $result["family_name"] . " " . $result["given_name"];
$result["id"] = $result["sub"];
file_put_contents("/mnt/familine/private/tokens/" . $token, json_encode($result));
- setcookie("FL_SESSION_TOKEN", $token, 0, "/", "." . $_CONFIG["Global"]["cdn"], true, true);
-
- header("Location: " . $_GET['r']);
+ setcookie("FL_SESSION_TOKEN", $token, 0, "/", "." . $_CONFIG["Global"]["domain"], true, true);
+
+ if (isset($_COOKIE["_auth_callback"])) {
+ header("Location: " . $_COOKIE['_auth_callback']);
+ die();
+ } else {
+ header("Location: https://app." . $_CONFIG["Global"]["domain"]);
+ die();
+ }
}
\ No newline at end of file |