Update CSRF token after each page load

This commit is contained in:
Sebastian Serth
2020-11-25 01:41:43 +01:00
parent c20d670ab2
commit bf9b90ab92

View File

@ -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();
});