mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Customize CSRF token error message
This commit is contained in:
@@ -402,6 +402,10 @@ if (!disableCsrf) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Customize the error message
|
||||||
|
csrfSyncProtection.invalidCsrfTokenError.message = color.red('Invalid CSRF token. Please refresh the page and try again.');
|
||||||
|
csrfSyncProtection.invalidCsrfTokenError.stack = undefined;
|
||||||
|
|
||||||
app.use(csrfSyncProtection.csrfSynchronisedProtection);
|
app.use(csrfSyncProtection.csrfSynchronisedProtection);
|
||||||
} else {
|
} else {
|
||||||
console.warn('\nCSRF protection is disabled. This will make your server vulnerable to CSRF attacks.\n');
|
console.warn('\nCSRF protection is disabled. This will make your server vulnerable to CSRF attacks.\n');
|
||||||
|
Reference in New Issue
Block a user