From d45268d87728fa3e5c85be379ca2ba98453ea22c Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Thu, 27 Aug 2020 08:51:46 -0400 Subject: [PATCH] SSO: Rebuild the server url without query string and/or hash (#4731) (#4734) (cherry picked from commit 7a0b5f982e076e8ad41ef7723bd937fb5c9ae78f) Co-authored-by: Elias Nahum --- app/screens/sso/sso.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/screens/sso/sso.js b/app/screens/sso/sso.js index cf7b2e53a4..bad3f70285 100644 --- a/app/screens/sso/sso.js +++ b/app/screens/sso/sso.js @@ -114,10 +114,11 @@ class SSO extends PureComponent { // Check whether we need to set a sub-path parsedUrl.set('pathname', original.pathname || ''); - parsedUrl.set('query', ''); - Client4.setUrl(parsedUrl.href); + // Rebuild the server url without query string and/or hash + const url = `${parsedUrl.origin}${parsedUrl.pathname}`; + Client4.setUrl(url); - CookieManager.get(parsedUrl.href, true).then((res) => { + CookieManager.get(url, true).then((res) => { const mmtoken = res.MMAUTHTOKEN; const csrf = res.MMCSRF; const token = typeof mmtoken === 'object' ? mmtoken.value : mmtoken;