From 72fb3ede132052bff1bb4c38029d0ffd4a55e72a Mon Sep 17 00:00:00 2001 From: aymm Date: Mon, 10 May 2021 21:27:33 +0200 Subject: [PATCH] #21 redirect to source page if parameter is set --- auth_callback.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/auth_callback.php b/auth_callback.php index a8b9f20..0ae4e6e 100644 --- a/auth_callback.php +++ b/auth_callback.php @@ -5,8 +5,13 @@ require_once __DIR__ .'/bootstrap.php'; if (isset($_GET['code'])) { $success = $api->authenticate($_GET['code']); + $from = empty($_GET['from']) ? null : $_GET['from']; + $page = 'index.php'; + if (!empty($_GET['from'])) { + $page = $_GET['from']; + } if ($success) { - redirect('index.php'); + redirect($page); } else { quit(get_page_header().'Echo error authenticating'); }