Skip to content

Commit

Permalink
move csrf token into formData for richTextModule (in bureaucracy lib)…
Browse files Browse the repository at this point in the history
…, v3.0.3 (#712)

* move csrf token into formData for bureaucracy

re publiclab/plots2#9438

* bumped version and built dist
  • Loading branch information
jywarren committed Apr 13, 2021
1 parent a8404b6 commit 0ac18eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/PublicLab.Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22208,7 +22208,7 @@ module.exports = function(textarea, _editor, _module) {
fieldKey: "image[photo]",

// additional form fields
formData: {nid: null},
formData: {nid: null, authenticity_token: _module.options.token},

// xhr upload options like CSRF token
xhrOptions: {
Expand Down Expand Up @@ -22242,7 +22242,7 @@ module.exports = function(textarea, _editor, _module) {
fieldKey: "image[photo]",

// additional form fields
formData: {nid: null},
formData: {nid: null, authenticity_token: _module.options.token},

// xhr upload options like CSRF token
xhrOptions: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "publiclab-editor",
"version": "3.0.2",
"version": "3.0.3",
"description": "PublicLab.Editor is a general purpose, JavaScript/Bootstrap UI framework for rich text posting, which provides an author-friendly, minimal, mobile/desktop (fluid) interface for creating blog-like content, designed for PublicLab.org",
"main": "dist/PublicLab.Editor.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/adapters/PublicLab.Woofmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = function(textarea, _editor, _module) {
fieldKey: "image[photo]",

// additional form fields
formData: {nid: null},
formData: {nid: null, authenticity_token: _module.options.token},

// xhr upload options like CSRF token
xhrOptions: {
Expand Down Expand Up @@ -99,7 +99,7 @@ module.exports = function(textarea, _editor, _module) {
fieldKey: "image[photo]",

// additional form fields
formData: {nid: null},
formData: {nid: null, authenticity_token: _module.options.token},

// xhr upload options like CSRF token
xhrOptions: {
Expand Down

0 comments on commit 0ac18eb

Please sign in to comment.