GeezerVison is showing github.com — fix(console): exclude migrated workspaces from selection (#49336) · jtrag/opencode@501ff62
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/console/app/src/routes
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/console/app/src/routes/auth/index.ts +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { redirect } from "@solidjs/router" |
| 2 | +import { Resource } from "@opencode-ai/console-resource" |
2 | 3 | import type { APIEvent } from "@solidjs/start/server" |
3 | 4 | import { getLastSeenWorkspaceID } from "../workspace/common" |
4 | 5 | import { localeFromRequest, route } from "~/lib/language" |
@@ -7,6 +8,11 @@ export async function GET(input: APIEvent) { |
7 | 8 | const locale = localeFromRequest(input.request) |
8 | 9 | try { |
9 | 10 | const workspaceID = await getLastSeenWorkspaceID() |
| 11 | + if (!workspaceID) { |
| 12 | + const destination = Resource.ConsoleMigration.consoleUrl |
| 13 | + if (!destination) throw new Error("New Console URL is not configured") |
| 14 | + return redirect(`${destination}/login`, { headers: { "Cache-Control": "no-store" } }) |
| 15 | + } |
10 | 16 | return redirect(route(locale, `/workspace/${workspaceID}`)) |
11 | 17 | } catch { |
12 | 18 | return redirect("/auth/authorize") |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/console/app/src/routes/workspace-picker.tsx +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,6 +27,7 @@ const getWorkspaces = query(async () => { |
27 | 27 | and( |
28 | 28 | eq(UserTable.accountID, Actor.account()), |
29 | 29 | isNull(WorkspaceTable.timeDeleted), |
| 30 | + isNull(WorkspaceTable.migrated_at), |
30 | 31 | isNull(UserTable.timeDeleted), |
31 | 32 | ), |
32 | 33 | ), |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/console/app/src/routes/workspace/common.tsx +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -53,6 +53,7 @@ export async function getLastSeenWorkspaceID() { |
53 | 53 | eq(UserTable.accountID, actor.properties.accountID), |
54 | 54 | isNull(UserTable.timeDeleted), |
55 | 55 | isNull(WorkspaceTable.timeDeleted), |
| 56 | + isNull(WorkspaceTable.migrated_at), |
56 | 57 | ), |
57 | 58 | ) |
58 | 59 | .orderBy(desc(UserTable.timeSeen)) |
|