From 01cf4b459ff49e37949118a511712f1ece36ea02 Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Thu, 7 Sep 2023 09:03:39 -0400 Subject: [PATCH] [MM-54402] Change protocol transform method for Desktop Auth to be compliant with web standards (#24479) --- webapp/channels/src/components/desktop_auth_token.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/webapp/channels/src/components/desktop_auth_token.tsx b/webapp/channels/src/components/desktop_auth_token.tsx index b4cf0350cd..5f9bd91365 100644 --- a/webapp/channels/src/components/desktop_auth_token.tsx +++ b/webapp/channels/src/components/desktop_auth_token.tsx @@ -85,13 +85,12 @@ const DesktopAuthToken: React.FC = ({href, onLogin}: Props) => { const forwardToDesktopApp = () => { const url = new URL(window.location.href); + let protocol = 'mattermost'; if (url.searchParams.get('isDesktopDev')) { - url.protocol = 'mattermost-dev'; - } else { - url.protocol = 'mattermost'; + protocol = 'mattermost-dev'; } - window.location.href = url.toString(); + window.location.href = url.toString().replace(url.protocol, `${protocol}:`); }; useEffect(() => {