2021-03-11 16:51:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
require_once __DIR__ .'/bootstrap.php';
|
|
|
|
|
|
|
|
if (isset($_GET['code'])) {
|
|
|
|
$success = $api->authenticate($_GET['code']);
|
2021-05-10 19:27:33 +00:00
|
|
|
$from = empty($_GET['from']) ? null : $_GET['from'];
|
|
|
|
$page = 'index.php';
|
|
|
|
if (!empty($_GET['from'])) {
|
|
|
|
$page = $_GET['from'];
|
|
|
|
}
|
2021-03-11 16:51:25 +00:00
|
|
|
if ($success) {
|
2021-05-10 19:27:33 +00:00
|
|
|
redirect($page);
|
2021-03-11 16:51:25 +00:00
|
|
|
} else {
|
2021-04-17 14:04:34 +00:00
|
|
|
quit(get_page_header().'Echo error authenticating');
|
2021-03-11 16:51:25 +00:00
|
|
|
}
|
|
|
|
} else {
|
2021-04-17 14:04:34 +00:00
|
|
|
quit(get_page_header().'Echo error authenticating: '. $_GET['error_message']);
|
2021-03-11 16:51:25 +00:00
|
|
|
}
|