summaryrefslogtreecommitdiffhomepage
path: root/packages/console/app/src/routes/auth/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/console/app/src/routes/auth/index.ts')
-rw-r--r--packages/console/app/src/routes/auth/index.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/console/app/src/routes/auth/index.ts b/packages/console/app/src/routes/auth/index.ts
new file mode 100644
index 000000000..2c893185f
--- /dev/null
+++ b/packages/console/app/src/routes/auth/index.ts
@@ -0,0 +1,13 @@
+import { Account } from "@opencode/console-core/account.js"
+import { redirect } from "@solidjs/router"
+import type { APIEvent } from "@solidjs/start/server"
+import { withActor } from "~/context/auth.withActor"
+
+export async function GET(input: APIEvent) {
+ try {
+ const workspaces = await withActor(async () => Account.workspaces())
+ return redirect(`/workspace/${workspaces[0].id}`)
+ } catch {
+ return redirect("/auth/authorize")
+ }
+}