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'); }