mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-18 21:20:39 +01:00
Customize CSRF token error message
This commit is contained in:
parent
2d8da60ffc
commit
44ade6ad64
@ -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);
|
||||
} else {
|
||||
console.warn('\nCSRF protection is disabled. This will make your server vulnerable to CSRF attacks.\n');
|
||||
|
Loading…
x
Reference in New Issue
Block a user