Update CSRF token after each page load
This commit is contained in:
@ -34,3 +34,9 @@ $.fn.replaceWithAndReturnNewElement = function(a) {
|
||||
// Disable the use of web workers for JStree due to JS error
|
||||
// See https://github.com/vakata/jstree/issues/1717 for details
|
||||
$.jstree.defaults.core.worker = false;
|
||||
|
||||
// Update all CSRF tokens on the page to reduce InvalidAuthenticityToken errors
|
||||
// See https://github.com/rails/jquery-ujs/issues/456 for details
|
||||
$(document).on('turbolinks:load', function(){
|
||||
$.rails.refreshCSRFTokens();
|
||||
});
|
||||
|
Reference in New Issue
Block a user