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(() => {