Skip to content

Commit

Permalink
Merge pull request #5329 from consuldemocracy/turbolinks_authenticity…
Browse files Browse the repository at this point in the history
…_token

Refresh CSRF Token when using Turbolinks
  • Loading branch information
Senen committed Dec 1, 2023
2 parents b815604 + 60a0fcf commit 49b3029
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down
8 changes: 8 additions & 0 deletions app/assets/javascripts/authenticity_token_refresh.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(function() {
"use strict";
App.AuthenticityTokenRefresh = {
initialize: function() {
$.rails.refreshCSRFTokens();
}
};
}).call(this);

0 comments on commit 49b3029

Please sign in to comment.