Skip to content

The open source coding agent.

TypeScript

wip: fix logout

Dax Raade8f54b9b3826
diff --git a/cloud/app/src/entry-server.tsx b/cloud/app/src/entry-server.tsx
index 41fc8fc8b5d..d2e6044aa1c 100644
--- a/cloud/app/src/entry-server.tsx
+++ b/cloud/app/src/entry-server.tsx
@@ -1,6 +1,7 @@
// @refresh reload
import { createHandler, StartServer } from "@solidjs/start/server"
+
export default createHandler(() => (
<StartServer
document={({ assets, children, scripts }) => (
diff --git a/cloud/app/src/routes/index.tsx b/cloud/app/src/routes/index.tsx
index bd2f8d1f13a..fd6bc23fa7e 100644
--- a/cloud/app/src/routes/index.tsx
+++ b/cloud/app/src/routes/index.tsx
@@ -1,6 +1,4 @@
import "./index.css"
-import "./workspace.css"
-import "./workspace/[id].css"
import { Title } from "@solidjs/meta"
import { Match, onCleanup, onMount, Switch } from "solid-js"
import logoLight from "../asset/logo-ornate-light.svg"
diff --git a/cloud/app/src/routes/workspace.tsx b/cloud/app/src/routes/workspace.tsx
index b97e21600ae..e3f70cab0b3 100644
--- a/cloud/app/src/routes/workspace.tsx
+++ b/cloud/app/src/routes/workspace.tsx
@@ -1,3 +1,4 @@
+import "./workspace.css"
import { useAuthSession } from "~/context/auth.session"
import { IconLogo } from "../component/icon"
import { withActor } from "~/context/auth.withActor"
@@ -28,6 +29,7 @@ const logout = action(async () => {
event!.locals.actor = undefined
return val
})
+ throw redirect("/")
})
export default function WorkspaceLayout(props: RouteSectionProps) {
@@ -43,7 +45,7 @@ export default function WorkspaceLayout(props: RouteSectionProps) {
</div>
<div data-slot="header-actions">
<span>{userInfo()?.user.email}</span>
- <form onSubmit={() => (location.href = "/")} action={logout} method="post">
+ <form action={logout} method="post">
<button type="submit" formaction={logout}>
Logout
</button>
diff --git a/cloud/app/src/routes/workspace/[id].tsx b/cloud/app/src/routes/workspace/[id].tsx
index d4a3500e7ae..2e3f526c3e2 100644
--- a/cloud/app/src/routes/workspace/[id].tsx
+++ b/cloud/app/src/routes/workspace/[id].tsx
@@ -1,3 +1,4 @@
+import "./[id].css"
import { Billing } from "@opencode/cloud-core/billing.js"
import { Key } from "@opencode/cloud-core/key.js"
import { action, createAsync, query, useAction, useSubmission, json, useParams } from "@solidjs/router"