#21 redirect to source page if parameter is set

v1.2.0
aymm 2021-05-10 21:27:33 +02:00
parent 6c93583f32
commit 72fb3ede13
Signed by: phlaym
GPG Key ID: A06651BAB6777237
1 changed files with 6 additions and 1 deletions

View File

@ -5,8 +5,13 @@ require_once __DIR__ .'/bootstrap.php';
if (isset($_GET['code'])) { if (isset($_GET['code'])) {
$success = $api->authenticate($_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) { if ($success) {
redirect('index.php'); redirect($page);
} else { } else {
quit(get_page_header().'Echo error authenticating'); quit(get_page_header().'Echo error authenticating');
} }