Skip to content

fix: restore the deep link after SSO login - #1206

Open
ssimpson89 wants to merge 1 commit into
ctrliq:mainfrom
ssimpson89:fix/sso-deeplink-restore
Open

ssimpson89 wants to merge 1 commit into
ctrliq:mainfrom
ssimpson89:fix/sso-deeplink-restore

Conversation

@ssimpson89

Copy link
Copy Markdown
Contributor
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
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • UI

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>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 22:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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 /home redirect.
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants