diff options
| author | Dax Raad <[email protected]> | 2025-09-02 18:00:48 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-09-02 18:00:48 -0400 |
| commit | 2e16d685eb5b37e022e7cbd6d4f1ea6cc05f9620 (patch) | |
| tree | e69988fdd16d0b16533f6abca22765af148939c5 /cloud/app/src/routes/auth/index.ts | |
| parent | e544cccc70cc717d3780bb3ee8a046d8314cc3f2 (diff) | |
| download | opencode-2e16d685eb5b37e022e7cbd6d4f1ea6cc05f9620.tar.gz opencode-2e16d685eb5b37e022e7cbd6d4f1ea6cc05f9620.zip | |
wip: zen
Diffstat (limited to 'cloud/app/src/routes/auth/index.ts')
| -rw-r--r-- | cloud/app/src/routes/auth/index.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cloud/app/src/routes/auth/index.ts b/cloud/app/src/routes/auth/index.ts new file mode 100644 index 000000000..308ae2d1d --- /dev/null +++ b/cloud/app/src/routes/auth/index.ts @@ -0,0 +1,13 @@ +import { Account } from "@opencode/cloud-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") + } +} |
