The "Wrong Token." message is shown whenever the token is wrong or not available. This commit adds more details into this message to help user's in their own troubleshooting.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2018-08-24 19:00:42 +02:00
parent 81561f5da5
commit 7a9fcc1676

View File

@@ -93,8 +93,16 @@ function check_csrf($token) {
session_start();
}
if(!isset($_SESSION['token']) || empty($token) || !hash_equals($_SESSION['token'], $token)) {
log_and_die("Wrong token");
if(!isset($_SESSION['token'])) {
log_and_die("Session expired! Please re-login on the Pi-hole dashboard.");
}
if(empty($token)) {
log_and_die("Empty token! Check if cookies are enabled on your system.");
}
if(!hash_equals($_SESSION['token'], $token)) {
log_and_die("Wrong token! Check if cookies are enabled on your system.");
}
}