mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
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:
@@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user