Repository navigation
fix: restore the deep link after SSO login - #1206
Open
ssimpson89 wants to merge 1 commit into
Open
ssimpson89 wants to merge 1 commit into
ssimpson89 wants to merge 1 commit into
Conversation
A user who opens a deep link while logged out and signs in through an SSO provider lands on the dashboard instead of the page they opened. The link survives the provider round trip only in sessionStorage, and App restored it by calling navigate() during render. React Router v6+ ignores navigate() until the component has mounted and only logs "You should call navigate() in a React.useEffect()", so the saved path was removed and the navigation dropped. This regressed in 5d0724c (ctrliq#425), which replaced v5's history.replace() with navigate(); every release since 25.5.0 is affected. Move the restore into an effect. Behaviour is otherwise unchanged: "/" and "/home" are still skipped, and removing the key first keeps re-runs a no-op. Add tests for the restore and the skip. Verified against a live OIDC (Dex) login on 25.6.3: stock lands on /home with the warning; patched lands on the deep link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the SSO deep-link redirect change.
No open issues 🎉
What changed in this PR
Restores deep-link navigation after SSO login by moving the saved-path redirect into a React effect, where React Router can perform it after mounting.
Changes:
- Moves redirect restoration out of render while preserving key removal and skipping
/and/home. - Adds tests for deep-link restoration and skipping a saved
/homeredirect.
| File | Description |
|---|---|
ascender/ui/src/App.tsx |
Restores the saved SSO redirect in a useEffect. |
ascender/ui/src/App.test.tsx |
Tests redirect restoration, key removal, and the home-page skip. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
A user who opens a deep link while logged out and signs in through an SSO provider lands on the dashboard instead of the page they opened.
The link survives the provider round trip only in sessionStorage, and App restored it by calling navigate() during render. React Router v6+ ignores navigate() until the component has mounted and only logs "You should call navigate() in a React.useEffect()", so the saved path was removed and the navigation dropped. This regressed in 5d0724c (#425), which replaced v5's history.replace() with navigate(); every release since 25.5.0 is affected.
Move the restore into an effect. Behaviour is otherwise unchanged: "/" and "/home" are still skipped, and removing the key first keeps re-runs a no-op. Add tests for the restore and the skip.
ISSUE TYPE
COMPONENT NAME