From 7a33881e145da2f2d5056914a51445d42779be3c Mon Sep 17 00:00:00 2001 From: Paulo Pinto Date: Tue, 13 Dec 2022 16:41:38 +0000 Subject: [PATCH] Only remove the loginToken query parameter after SSO Leave other query parameters untouched. --- src/domain/navigation/URLRouter.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/domain/navigation/URLRouter.ts b/src/domain/navigation/URLRouter.ts index 6672e89f..c69246ee 100644 --- a/src/domain/navigation/URLRouter.ts +++ b/src/domain/navigation/URLRouter.ts @@ -153,8 +153,11 @@ export class URLRouter implements IURLRou } normalizeUrl(): void { - // Remove any queryParameters from the URL - // Gets rid of the loginToken after SSO - this._history.replaceUrlSilently(`${window.location.origin}/${window.location.hash}`); + const url = new URL(window.location.href); + + // Remove the loginToken query parameter from the URL after SSO. + url.searchParams.delete("loginToken"); + + this._history.replaceUrlSilently(url.toString()); } }