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=""
### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results -->
> [!CAUTION]
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.
<!-- end of auto-generated comment: Cypress test results -->
## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Bug Fixes**
- Enhanced session token validation to ensure extraneous URL parameters
are removed, resulting in cleaner URLs for users.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
44295892b3
commit
de2f24ca3e
|
|
@ -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<boolean> => {
|
|||
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());
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user