From a35b9bd4bf5b02c5eff5cb040e8d239dc3dd9abb Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Fri, 6 Jul 2018 04:08:27 -0400 Subject: [PATCH] MM-11158: fix subpath logout (#1409) Fall back to window.basename instead of window.location.origin, to ensure the subpath is reflected on logout. --- selectors/general.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/selectors/general.js b/selectors/general.js index 0a00a3f2db00..b01e8403d977 100644 --- a/selectors/general.js +++ b/selectors/general.js @@ -17,5 +17,9 @@ export function areTimezonesEnabledAndSupported(state) { export function getBasePath(state) { const config = getConfig(state) || {}; - return new URL(config.SiteURL || window.location.origin).pathname; + if (config.SiteURL) { + return new URL(config.SiteURL).pathname; + } + + return window.basename || window.location.origin; }