summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
Diffstat (limited to 'auth')
-rw-r--r--auth/callback/index.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/auth/callback/index.php b/auth/callback/index.php
index 8419364..8d040e9 100644
--- a/auth/callback/index.php
+++ b/auth/callback/index.php
@@ -56,6 +56,12 @@ if (isset($result["access_token"])) {
header("Set-Cookie: PEH2_SESSION_TOKEN=" . $token . "; SameSite=None; Path=/; Secure; HttpOnly; Expires=" . date("r", time() + (86400 * 730)));
- header("Location: /");
+ if (isset($_COOKIE["PEH2_RETURN_PAGE"])) {
+ header("Location: " . str_replace("\n", "", str_replace("\r", "", $_COOKIE["PEH2_RETURN_PAGE"])));
+ } else {
+ header("Location: /");
+ }
+
+ setcookie("PEH2_RETURN_PAGE", "");
die();
} \ No newline at end of file