From de2f24ca3e1679a2da896c199354f64d15bda617 Mon Sep 17 00:00:00 2001 From: Trisha Anand Date: Thu, 3 Apr 2025 16:45:01 +0530 Subject: [PATCH] chore: Adding cleanup for a query param post successful session transfer (#40067) ## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="" ### :mag: Cypress test results > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **Bug Fixes** - Enhanced session token validation to ensure extraneous URL parameters are removed, resulting in cleaner URLs for users. --- app/client/src/utils/SessionUtils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/client/src/utils/SessionUtils.ts b/app/client/src/utils/SessionUtils.ts index bd0308b439..e4674a4886 100644 --- a/app/client/src/utils/SessionUtils.ts +++ b/app/client/src/utils/SessionUtils.ts @@ -8,6 +8,7 @@ export const DELETE_SESSION_PARAM = "deleteSession"; export const SESSION_TRANSFER_PHASE_PARAM = "sessionTransferPhase"; export const CSRF_TOKEN_PARAM = "csrfToken"; export const TRANSFER_PHASE_PARAM = "transferPhase"; +export const SOURCE_DOMAIN_PARAM = "sourceDomain"; /** * Validates a session token from the URL and sets up the session. @@ -48,6 +49,7 @@ export const validateSessionToken = async (): Promise => { url.searchParams.delete(SESSION_TRANSFER_PHASE_PARAM); url.searchParams.delete(CSRF_TOKEN_PARAM); url.searchParams.delete(TRANSFER_PHASE_PARAM); + url.searchParams.delete(SOURCE_DOMAIN_PARAM); window.history.replaceState({}, "", url.toString());