diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-03-25 15:54:18 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-05-25 15:05:23 +0200 |
commit | 986a52106766e7497322951c2bf3a3cbd0b42bf9 (patch) | |
tree | 5e1817c4316edb909c3cc384b06b7aeecf3c4516 /index.php | |
parent | 8b27824338eb445d69730c9b05f05b131ccea52f (diff) | |
download | Shaarli-986a52106766e7497322951c2bf3a3cbd0b42bf9.tar.gz Shaarli-986a52106766e7497322951c2bf3a3cbd0b42bf9.tar.zst Shaarli-986a52106766e7497322951c2bf3a3cbd0b42bf9.zip |
Add an endpoint to refresh the token
Useful for AJAX requests which burns the token
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1582,6 +1582,13 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history) | |||
1582 | exit; | 1582 | exit; |
1583 | } | 1583 | } |
1584 | 1584 | ||
1585 | // Get a fresh token | ||
1586 | if ($targetPage == Router::$GET_TOKEN) { | ||
1587 | header('Content-Type:text/plain'); | ||
1588 | echo getToken($conf); | ||
1589 | exit; | ||
1590 | } | ||
1591 | |||
1585 | // -------- Otherwise, simply display search form and links: | 1592 | // -------- Otherwise, simply display search form and links: |
1586 | showLinkList($PAGE, $LINKSDB, $conf, $pluginManager); | 1593 | showLinkList($PAGE, $LINKSDB, $conf, $pluginManager); |
1587 | exit; | 1594 | exit; |