From ccd46bf431f1f605d8440a3589f9fa3ae5d85224 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Mon, 12 Oct 2015 16:14:39 -0300 Subject: [PATCH 1/2] Fix impersonate redirect on subfolder install Impersonate was redirecting to base site, instead of Discourse when using subfolder install. --- app/assets/javascripts/admin/models/admin-user.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/models/admin-user.js.es6 b/app/assets/javascripts/admin/models/admin-user.js.es6 index e8db973a8..12e128a9c 100644 --- a/app/assets/javascripts/admin/models/admin-user.js.es6 +++ b/app/assets/javascripts/admin/models/admin-user.js.es6 @@ -228,7 +228,7 @@ const AdminUser = Discourse.User.extend({ type: 'POST', data: { username_or_email: this.get('username') } }).then(function() { - document.location = Discourse.getURL("/"); + document.location = Discourse.getURL(Discourse.BaseUri); }).catch(function(e) { if (e.status === 404) { bootbox.alert(I18n.t('admin.impersonate.not_found')); From dfed999ec8cc8ba03f5a774a8c3f3f55d02142c9 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Tue, 13 Oct 2015 16:52:35 -0300 Subject: [PATCH 2/2] Remove getUrl on impersonate redirect As said by @riking @nlalonde and @ZogStriP --- app/assets/javascripts/admin/models/admin-user.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/models/admin-user.js.es6 b/app/assets/javascripts/admin/models/admin-user.js.es6 index 12e128a9c..1e83de620 100644 --- a/app/assets/javascripts/admin/models/admin-user.js.es6 +++ b/app/assets/javascripts/admin/models/admin-user.js.es6 @@ -228,7 +228,7 @@ const AdminUser = Discourse.User.extend({ type: 'POST', data: { username_or_email: this.get('username') } }).then(function() { - document.location = Discourse.getURL(Discourse.BaseUri); + document.location = Discourse.BaseUri; }).catch(function(e) { if (e.status === 404) { bootbox.alert(I18n.t('admin.impersonate.not_found'));