diff --git a/frontend/src/lib/components/Login.svelte b/frontend/src/lib/components/Login.svelte index 412884cb07..b4e8e8ee6a 100644 --- a/frontend/src/lib/components/Login.svelte +++ b/frontend/src/lib/components/Login.svelte @@ -196,7 +196,13 @@ } else { goto(resolvedRd ?? '/') } - } else if (resolvedRd?.startsWith('/user/workspaces')) { + // The import wizard picks the destination workspace itself, so sending it to + // the workspace picker first asks the same question twice — and the wizard + // may end in a workspace that does not exist yet. + } else if ( + resolvedRd?.startsWith('/user/workspaces') || + resolvedRd?.startsWith('/projects/import') + ) { goto(resolvedRd) } else if (resolvedRd == '/#user-settings') { goto(`/user/workspaces#user-settings`) diff --git a/frontend/src/routes/(root)/(logged)/user/(user)/login/+page.svelte b/frontend/src/routes/(root)/(logged)/user/(user)/login/+page.svelte index 2ea7ab1c89..dea6e2cc64 100644 --- a/frontend/src/routes/(root)/(logged)/user/(user)/login/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/user/(user)/login/+page.svelte @@ -106,7 +106,10 @@ } else { goto(rd ?? '/') } - } else if (rd?.startsWith('/user/workspaces')) { + // The import wizard picks the destination workspace itself, so sending it to + // the workspace picker first asks the same question twice — and the wizard + // may end in a workspace that does not exist yet. + } else if (rd?.startsWith('/user/workspaces') || rd?.startsWith('/projects/import')) { goto(rd) } else if (rd == '/#user-settings') { goto(`/user/workspaces#user-settings`) diff --git a/frontend/src/routes/(root)/+layout.svelte b/frontend/src/routes/(root)/+layout.svelte index 1f7a813eac..9d0b9aaef6 100644 --- a/frontend/src/routes/(root)/+layout.svelte +++ b/frontend/src/routes/(root)/+layout.svelte @@ -146,7 +146,11 @@ } else { if ( (!page.url.pathname.startsWith('/user/') || page.url.pathname.startsWith('/user/cli')) && - !page.url.pathname.startsWith('/oauth/mcp_authorize') + !page.url.pathname.startsWith('/oauth/mcp_authorize') && + // The hub import wizard asks for the destination itself, and may end in a + // workspace that does not exist yet — bouncing it to the picker would + // force the very choice it exists to make. + !page.url.pathname.startsWith('/projects/import') ) { goto( `/user/workspaces?rd=${encodeURIComponent(page.url.href.replace(page.url.origin, ''))}`