Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix `BAD CSRF` errors for admin POST requests when on Ember CLI (#12908)

Osama Sayegh19ee38b78a57
diff --git a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
index a4e91e10f79..8c5cd665f36 100644
--- a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
+++ b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
@@ -22,12 +22,12 @@ function htmlTag(buffer, bootstrap) {
function head(buffer, bootstrap) {
if (bootstrap.csrf_token) {
- buffer.push(`<meta name="csrf-param" buffer="authenticity_token">`);
- buffer.push(`<meta name="csrf-token" buffer="${bootstrap.csrf_token}">`);
+ buffer.push(`<meta name="csrf-param" content="authenticity_token">`);
+ buffer.push(`<meta name="csrf-token" content="${bootstrap.csrf_token}">`);
}
if (bootstrap.theme_ids) {
buffer.push(
- `<meta name="discourse_theme_ids" buffer="${bootstrap.theme_ids}">`
+ `<meta name="discourse_theme_ids" content="${bootstrap.theme_ids}">`
);
}