Skip to content

Conversation

@ryanbonial
Copy link
Member

@ryanbonial ryanbonial commented Oct 15, 2025

Description

Improved the getCleanedUrl function to preserve hash fragments while only removing the token and withSid parameter. Previously, the function would remove the entire hash, but now it selectively removes only the token and withSid parameters while keeping other hash parameters intact. This provides a better user experience by maintaining URL state after authentication.

What to review

  • The updated implementation of getCleanedUrl in utils.ts which now preserves hash fragments
  • The comprehensive test cases that verify different URL cleaning scenarios
  • Verify that the function correctly handles:
    • URLs with token as the only hash parameter
    • URLs with token among multiple hash parameters
    • URLs with non key-value hash fragments
    • URLs with query parameters that should be preserved or removed

Testing

Added comprehensive test cases that cover various URL scenarios:

  • Removing token when it's the only hash parameter
  • Preserving other hash parameters when removing token
  • Handling token in the middle of multiple hash parameters
  • Removing sid and url from query parameters while preserving others
  • Preserving non key-value hash fragments

Fun gif

hash

@ryanbonial ryanbonial requested a review from a team as a code owner October 15, 2025 20:01
@vercel
Copy link

vercel bot commented Oct 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sdk-docs Ready Ready Preview Comment Oct 15, 2025 8:13pm
sdk-kitchensink-react Ready Ready Preview Comment Oct 15, 2025 8:13pm

Copy link
Contributor

@laurenashpole laurenashpole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ryanbonial ryanbonial merged commit 5267e18 into main Oct 15, 2025
22 of 23 checks passed
@ryanbonial ryanbonial deleted the SDK-645/only-remove-token-hash branch October 15, 2025 20:21
@squiggler squiggler bot mentioned this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants