Refresh CSRF Token when using Turbolinks
This commit is contained in:
committed by
Senén Rodero Rodríguez
parent
b8156040a5
commit
60a0fcfea5
@@ -121,6 +121,7 @@
|
||||
//= require budget_edit_associations
|
||||
//= require budget_hide_money
|
||||
//= require datepicker
|
||||
//= require authenticity_token_refresh
|
||||
//= require_tree ./admin
|
||||
//= require_tree ./sdg
|
||||
//= require_tree ./sdg_management
|
||||
@@ -183,6 +184,7 @@ var initialize_modules = function() {
|
||||
App.Datepicker.initialize();
|
||||
App.SDGRelatedListSelector.initialize();
|
||||
App.SDGManagementRelationSearch.initialize();
|
||||
App.AuthenticityTokenRefresh.initialize();
|
||||
};
|
||||
|
||||
var destroy_non_idempotent_modules = function() {
|
||||
|
||||
8
app/assets/javascripts/authenticity_token_refresh.js
Normal file
8
app/assets/javascripts/authenticity_token_refresh.js
Normal file
@@ -0,0 +1,8 @@
|
||||
(function() {
|
||||
"use strict";
|
||||
App.AuthenticityTokenRefresh = {
|
||||
initialize: function() {
|
||||
$.rails.refreshCSRFTokens();
|
||||
}
|
||||
};
|
||||
}).call(this);
|
||||
Reference in New Issue
Block a user