[MM-54402] Change protocol transform method for Desktop Auth to be compliant with web standards (#24479)

This commit is contained in:
Devin Binnie
2023-09-07 09:03:39 -04:00
committed by GitHub
parent c656ca3fe3
commit 01cf4b459f

View File

@@ -85,13 +85,12 @@ const DesktopAuthToken: React.FC<Props> = ({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(() => {