8000 BED-5811: Get rid of homepage redirect loop by maffkipp · Pull Request #1420 · SpecterOps/BloodHound · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

BED-5811: Get rid of homepage redirect loop #1420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 12, 2025

Conversation

maffkipp
Copy link
Contributor
@maffkipp maffkipp commented Apr 30, 2025

Description

Currently, once a user logs in to the application, if they try to click back they will end up in a redirect loop and will not be able to progress any further back in their browser's history.

This change updates these redirects to use the replace prop from react-router, which will replace the current entry on the history stack instead of pushing a new entry. This means that if a user clicks back immediately after logging in, they should end up on whatever page they were on before they navigated to our application.

This change also plumbs through a second optional param to our setter functions for query params introduced with deep linking. This allows us to pass react routers' NavigateOptions object through to those URL updates.

Motivation and Context

Resolves: BED-5811

How Has This Been Tested?

  • All existing tests pass, manual testing to make sure redirects behave the way we want

Screenshots (optional):

Screen.Recording.2025-04-30.at.10.04.00.AM.mov

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

@maffkipp maffkipp added bug Something isn't working user interface A pull request containing changes affecting the UI code. labels Apr 30, 2025
@maffkipp maffkipp self-assigned this Apr 30, 2025
export const setParamsFactory = <T>(
setSearchParams: SetURLSearchParams,
availableParams: Array<keyof T>,
navigateOpts?: NavigateOptions
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! This is a lot cleaner than I thought it would be lol

@StephenHinck
Copy link
Contributor

I appreciate y'all identifying and fixing this issue. Getting stuck in a "login loop" from redirects is always incredibly frustrating.

@maffkipp maffkipp merged commit e0d3c5c into main May 12, 2025
8 checks passed
@maffkipp maffkipp deleted the BED-5811--default-environment branch May 12, 2025 22:05
@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working user interface A pull request containing changes affecting the UI code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0