diff --git a/bl-kernel/admin/controllers/api.php b/bl-kernel/admin/controllers/api.php new file mode 100644 index 00000000..5b20d7b7 --- /dev/null +++ b/bl-kernel/admin/controllers/api.php @@ -0,0 +1,40 @@ +getToken(); +$username = $login->username(); +$admin = new User($username); +$authToken = $admin->tokenAuth(); +$output = array( + 'apiURL'=>$apiURL, + 'username'=>$username, + 'apiToken'=>$apiToken, + 'authToken'=>$authToken +); +exit(json_encode($output)); + +?> \ No newline at end of file diff --git a/bl-kernel/admin/controllers/login.php b/bl-kernel/admin/controllers/login.php index 9b9da20c..8440ac79 100644 --- a/bl-kernel/admin/controllers/login.php +++ b/bl-kernel/admin/controllers/login.php @@ -26,6 +26,9 @@ function checkLogin($args) // Renew the token. This token will be the same inside the session for multiple forms. $security->generateTokenCSRF(); + if (isset($_GET['enableAPI'])) { + Redirect::page('api'); + } Redirect::page('dashboard'); return true; }