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 /application/Router.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 'application/Router.php')
-rw-r--r-- | application/Router.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/application/Router.php b/application/Router.php index c9a51912..f6896b1c 100644 --- a/application/Router.php +++ b/application/Router.php | |||
@@ -45,6 +45,8 @@ class Router | |||
45 | 45 | ||
46 | public static $PAGE_SAVE_PLUGINSADMIN = 'save_pluginadmin'; | 46 | public static $PAGE_SAVE_PLUGINSADMIN = 'save_pluginadmin'; |
47 | 47 | ||
48 | public static $GET_TOKEN = 'token'; | ||
49 | |||
48 | /** | 50 | /** |
49 | * Reproducing renderPage() if hell, to avoid regression. | 51 | * Reproducing renderPage() if hell, to avoid regression. |
50 | * | 52 | * |
@@ -142,6 +144,10 @@ class Router | |||
142 | return self::$PAGE_SAVE_PLUGINSADMIN; | 144 | return self::$PAGE_SAVE_PLUGINSADMIN; |
143 | } | 145 | } |
144 | 146 | ||
147 | if (startsWith($query, 'do='. self::$GET_TOKEN)) { | ||
148 | return self::$GET_TOKEN; | ||
149 | } | ||
150 | |||
145 | return self::$PAGE_LINKLIST; | 151 | return self::$PAGE_LINKLIST; |
146 | } | 152 | } |
147 | } | 153 | } |