FIX: error in csrf initializer on subfolder installs
This commit is contained in:
parent
678a42121e
commit
6cc5e4856b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue