diff options
| author | Dax Raad <[email protected]> | 2025-08-30 01:36:25 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-08-30 01:36:25 -0400 |
| commit | 48e01cfee793a9cfc4d17794abf808f71a35c888 (patch) | |
| tree | f9b4e616cf9102348158504cf9fe8f57684c8cc5 /cloud/app/src | |
| parent | b54aa65f5f0f1eba6890843df010642ce25ee7d8 (diff) | |
| download | opencode-48e01cfee793a9cfc4d17794abf808f71a35c888.tar.gz opencode-48e01cfee793a9cfc4d17794abf808f71a35c888.zip | |
ignore: sync
Diffstat (limited to 'cloud/app/src')
| -rw-r--r-- | cloud/app/src/routes/workspace.css (renamed from cloud/app/src/routes/workspace/workspace.css) | 5 | ||||
| -rw-r--r-- | cloud/app/src/routes/workspace.tsx | 22 | ||||
| -rw-r--r-- | cloud/app/src/routes/workspace/[id].css (renamed from cloud/app/src/routes/workspace/index.css) | 0 | ||||
| -rw-r--r-- | cloud/app/src/routes/workspace/[id].tsx | 6 |
4 files changed, 26 insertions, 7 deletions
diff --git a/cloud/app/src/routes/workspace/workspace.css b/cloud/app/src/routes/workspace.css index 3390fbea6..e18b410ee 100644 --- a/cloud/app/src/routes/workspace/workspace.css +++ b/cloud/app/src/routes/workspace.css @@ -52,7 +52,10 @@ color: var(--color-text-muted); } - a { + a, + button { + border: none; + padding: 0; color: var(--color-text); text-decoration: underline; text-underline-offset: var(--space-0-75); diff --git a/cloud/app/src/routes/workspace.tsx b/cloud/app/src/routes/workspace.tsx index 864fab4d3..920276e8c 100644 --- a/cloud/app/src/routes/workspace.tsx +++ b/cloud/app/src/routes/workspace.tsx @@ -1,6 +1,20 @@ +import { useAuthSession } from "~/context/auth.session" import { IconLogo } from "../component/icon" -import "./workspace/workspace.css" -import { RouteSectionProps } from "@solidjs/router" +import "./workspace.css" +import { action, redirect, RouteSectionProps } from "@solidjs/router" + +const logout = action(async () => { + "use server" + const auth = await useAuthSession() + const current = auth.data.current + if (current) + await auth.update((val) => { + delete val.account[current] + return val + }) + + return redirect("/") +}) export default function WorkspaceLayout(props: RouteSectionProps) { return ( @@ -13,7 +27,9 @@ export default function WorkspaceLayout(props: RouteSectionProps) { </div> <div data-slot="header-actions"> <span>[email protected]</span> - <a href="/logout">Logout</a> + <form action={logout} method="post"> + <button type="submit" formaction={logout}>Logout</button> + </form> </div> </header> <div data-slot="content">{props.children}</div> diff --git a/cloud/app/src/routes/workspace/index.css b/cloud/app/src/routes/workspace/[id].css index 887469e33..887469e33 100644 --- a/cloud/app/src/routes/workspace/index.css +++ b/cloud/app/src/routes/workspace/[id].css diff --git a/cloud/app/src/routes/workspace/[id].tsx b/cloud/app/src/routes/workspace/[id].tsx index 81013dc92..416128867 100644 --- a/cloud/app/src/routes/workspace/[id].tsx +++ b/cloud/app/src/routes/workspace/[id].tsx @@ -1,11 +1,11 @@ import { Billing } from "@opencode/cloud-core/billing.js" import { Key } from "@opencode/cloud-core/key.js" -import { action, createAsync, revalidate, query, useAction, useSubmission, json } from "@solidjs/router" -import { createEffect, createSignal, For, onMount, Show } from "solid-js" +import { action, createAsync, query, useAction, useSubmission, json } from "@solidjs/router" +import { createSignal, For, onMount, Show } from "solid-js" import { getActor } from "~/context/auth" import { withActor } from "~/context/auth.withActor" import { IconCopy, IconCheck } from "~/component/icon" -import "./index.css" +import "./[id].css" import { User } from "@opencode/cloud-core/user.js" import { Actor } from "@opencode/cloud-core/actor.js" |
