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';
export default {
name: "findCsrfToken",
initialize() {
return request('/session/csrf').then(function(result) {
return request(Discourse.getURL('/session/csrf')).then(function(result) {
var token = result.csrf;
$.ajaxPrefilter(function(options, originalOptions, xhr) {
if (!options.crossDomain) {

View File

@ -66,7 +66,7 @@ var Repo = Ember.Object.extend({
var self = this;
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);
});
}