fix(ui): preserve deeplink redirect after login#2926
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughLogin now reads the preserved router location state, reconstructs the original deeplink path, and redirects authenticated users to that target instead of always sending them to the home route. ChangesLogin deeplink redirect
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I have read the CLA Document and I hereby sign the CLA |
Description
This change fixes navigating BloodHound utilizing deeplinks when not logged in.
AuthenticatedRoutepreserves the original route in React Router state when redirecting unauthenticated users to/login, butLogin.tsxalways redirects authenticated users toROUTE_HOMEinstead of the deeplink route.This change changes the state location and redirects users back to their original destination after successful authentication. If no prior route exists, it would go back to
ROUTE_HOMEas usual.Motivation and Context
Resolves #2806
Users opening a Bloodhound deeplink while unauthenticated should be returned to that deeplink after logging in. This change fixes that, letting users land on the change query or graph instead of the default blank view.
How Has This Been Tested?
just bh-dev./loginand then redirected back to original deeplink after authenticating.Screenshots (optional):
N/A
Types of changes
Checklist:
Summary by CodeRabbit