parent
c4a0152dc6
commit
7787770758
|
@ -134,8 +134,6 @@ Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||
// Add a CSRF token to all AJAX requests
|
||||
Discourse.csrfToken = $('meta[name=csrf-token]').attr('content');
|
||||
|
||||
console.log(Discourse.csrfToken);
|
||||
|
||||
$.ajaxPrefilter(function(options, originalOptions, xhr) {
|
||||
if (!options.crossDomain) {
|
||||
xhr.setRequestHeader('X-CSRF-Token', Discourse.csrfToken);
|
||||
|
|
|
@ -58,7 +58,7 @@ Discourse.Ajax = Em.Mixin.create({
|
|||
|
||||
// note: for bad CSRF we don't loop an extra request right away.
|
||||
// this allows us to eliminate the possibility of having a loop.
|
||||
if (xhr.status === 403 && xhr.responseText == "['BAD CSRF']") {
|
||||
if (xhr.status === 403 && xhr.responseText === "['BAD CSRF']") {
|
||||
Discourse.csrfToken = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue