From 764d34a7d347d653414e5f5c632e02499edaef04 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 21 Jun 2020 12:21:31 +0200 Subject: Process token retrieve through Slim controller --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 1571df60..9202cb84 100644 --- a/index.php +++ b/index.php @@ -597,8 +597,7 @@ function renderPage($conf, $pluginManager, $bookmarkService, $history, $sessionM // Get a fresh token if ($targetPage == Router::$GET_TOKEN) { - header('Content-Type:text/plain'); - echo $sessionManager->generateToken(); + header('Location: ./admin/token'); exit; } @@ -978,6 +977,7 @@ $app->group('', function () { $this->post('/admin/import', '\Shaarli\Front\Controller\Admin\ImportController:import'); $this->get('/admin/plugins', '\Shaarli\Front\Controller\Admin\PluginsController:index'); $this->post('/admin/plugins', '\Shaarli\Front\Controller\Admin\PluginsController:save'); + $this->get('/admin/token', '\Shaarli\Front\Controller\Admin\TokenController:getToken'); $this->get('/links-per-page', '\Shaarli\Front\Controller\Admin\SessionFilterController:linksPerPage'); $this->get('/visibility/{visibility}', '\Shaarli\Front\Controller\Admin\SessionFilterController:visibility'); -- cgit v1.2.3