dragonpolls/auth_callback.php

21 lines
470 B
PHP
Raw Normal View History

2021-03-11 16:51:25 +00:00
<?php
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'];
}
2021-03-11 16:51:25 +00:00
if ($success) {
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
}