]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Add an endpoint to refresh the token
[github/shaarli/Shaarli.git] / index.php
index 40539a04666c1c16acbad9c604a5e7a2cef48cc0..9566fb016f14156fa3efc7bec609d5e2b9763e31 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1582,6 +1582,13 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
         exit;
     }
 
+    // Get a fresh token
+    if ($targetPage == Router::$GET_TOKEN) {
+        header('Content-Type:text/plain');
+        echo getToken($conf);
+        exit;
+    }
+
     // -------- Otherwise, simply display search form and links:
     showLinkList($PAGE, $LINKSDB, $conf, $pluginManager);
     exit;