Download packages/console/app/src/routes/auth/index.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 496 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/console/app/src/routes/auth/index.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/console/app/src/routes/auth/index.ts
-
curl -L -o index.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/console/app/src/routes/auth/index.ts
496 Bytes
| import { redirect } from "@solidjs/router" | |
| import type { APIEvent } from "@solidjs/start/server" | |
| import { getLastSeenWorkspaceID } from "../workspace/common" | |
| import { localeFromRequest, route } from "~/lib/language" | |
| export async function GET(input: APIEvent) { | |
| const locale = localeFromRequest(input.request) | |
| try { | |
| const workspaceID = await getLastSeenWorkspaceID() | |
| return redirect(route(locale, `/workspace/${workspaceID}`)) | |
| } catch { | |
| return redirect("/auth/authorize") | |
| } | |
| } | |