FIX: error in csrf initializer on subfolder installs

This commit is contained in:
Neil Lalonde 2017-01-16 14:52:53 -05:00
parent 678a42121e
commit 6cc5e4856b
4 changed files with 27 additions and 27 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,11 @@
/* global $:true */ /* global $:true, Discourse */
import request from 'ember-ajax/request'; import request from 'ember-ajax/request';
export default { export default {
name: "findCsrfToken", name: "findCsrfToken",
initialize() { initialize() {
return request('/session/csrf').then(function(result) { return request(Discourse.getURL('/session/csrf')).then(function(result) {
var token = result.csrf; var token = result.csrf;
$.ajaxPrefilter(function(options, originalOptions, xhr) { $.ajaxPrefilter(function(options, originalOptions, xhr) {
if (!options.crossDomain) { if (!options.crossDomain) {

View File

@ -66,7 +66,7 @@ var Repo = Ember.Object.extend({
var self = this; var self = this;
this.set('upgrading', true); this.set('upgrading', true);
return this.repoAjax(Discourse.getURL('/admin/docker/upgrade'), { dataType: 'text', type: 'POST' }).catch(function(e) { return this.repoAjax(Discourse.getURL('/admin/docker/upgrade'), { dataType: 'text', type: 'POST' }).catch(function() {
self.set('upgrading', false); self.set('upgrading', false);
}); });
} }