]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Process token retrieve through Slim controller
[github/shaarli/Shaarli.git] / index.php
index 1571df60c9fa6f6085e1e21021712f2c0d2d0fdb..9202cb84689badd4371e6f2f1e39d98cc6a4961f 100644 (file)
--- 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');