From 501ff62cbf40d4ff260b48c9f1fc113e9b9a83e1 Mon Sep 17 00:00:00 2001 From: Victor Navarro Date: Wed, 16 Sep 2026 15:07:22 +0200 Subject: [PATCH] fix(console): exclude migrated workspaces from selection (#49336) --- packages/console/app/src/routes/auth/index.ts | 6 ++++++ packages/console/app/src/routes/workspace-picker.tsx | 1 + packages/console/app/src/routes/workspace/common.tsx | 1 + 3 files changed, 8 insertions(+) diff --git a/packages/console/app/src/routes/auth/index.ts b/packages/console/app/src/routes/auth/index.ts index 0fefb98933..3840d653e1 100644 --- a/packages/console/app/src/routes/auth/index.ts +++ b/packages/console/app/src/routes/auth/index.ts @@ -1,4 +1,5 @@ import { redirect } from "@solidjs/router" +import { Resource } from "@opencode-ai/console-resource" import type { APIEvent } from "@solidjs/start/server" import { getLastSeenWorkspaceID } from "../workspace/common" import { localeFromRequest, route } from "~/lib/language" @@ -7,6 +8,11 @@ export async function GET(input: APIEvent) { const locale = localeFromRequest(input.request) try { const workspaceID = await getLastSeenWorkspaceID() + if (!workspaceID) { + const destination = Resource.ConsoleMigration.consoleUrl + if (!destination) throw new Error("New Console URL is not configured") + return redirect(`${destination}/login`, { headers: { "Cache-Control": "no-store" } }) + } return redirect(route(locale, `/workspace/${workspaceID}`)) } catch { return redirect("/auth/authorize") diff --git a/packages/console/app/src/routes/workspace-picker.tsx b/packages/console/app/src/routes/workspace-picker.tsx index 83f5582ebe..1bd5fa2f8f 100644 --- a/packages/console/app/src/routes/workspace-picker.tsx +++ b/packages/console/app/src/routes/workspace-picker.tsx @@ -27,6 +27,7 @@ const getWorkspaces = query(async () => { and( eq(UserTable.accountID, Actor.account()), isNull(WorkspaceTable.timeDeleted), + isNull(WorkspaceTable.migrated_at), isNull(UserTable.timeDeleted), ), ), diff --git a/packages/console/app/src/routes/workspace/common.tsx b/packages/console/app/src/routes/workspace/common.tsx index fb315eefd5..a5384d9f42 100644 --- a/packages/console/app/src/routes/workspace/common.tsx +++ b/packages/console/app/src/routes/workspace/common.tsx @@ -53,6 +53,7 @@ export async function getLastSeenWorkspaceID() { eq(UserTable.accountID, actor.properties.accountID), isNull(UserTable.timeDeleted), isNull(WorkspaceTable.timeDeleted), + isNull(WorkspaceTable.migrated_at), ), ) .orderBy(desc(UserTable.timeSeen))