diff options
| author | Dax Raad <[email protected]> | 2025-09-03 14:07:23 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-09-03 14:07:23 -0400 |
| commit | ff89305ebee28d1d19d963bfdef809f0ae632ea5 (patch) | |
| tree | e4e0e3de24f28de8e3e71bc7f781709f8577f98a /cloud/app/src/routes | |
| parent | 605f78944d81b897ba449a4ee0c016d27803180e (diff) | |
| download | opencode-ff89305ebee28d1d19d963bfdef809f0ae632ea5.tar.gz opencode-ff89305ebee28d1d19d963bfdef809f0ae632ea5.zip | |
wip: logout
Diffstat (limited to 'cloud/app/src/routes')
| -rw-r--r-- | cloud/app/src/routes/workspace.tsx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cloud/app/src/routes/workspace.tsx b/cloud/app/src/routes/workspace.tsx index c14692bad..b97e21600 100644 --- a/cloud/app/src/routes/workspace.tsx +++ b/cloud/app/src/routes/workspace.tsx @@ -4,6 +4,7 @@ import { withActor } from "~/context/auth.withActor" import { query, action, redirect, createAsync, RouteSectionProps, Navigate, useNavigate, useParams, A } from "@solidjs/router" import { User } from "@opencode/cloud-core/user.js" import { Actor } from "@opencode/cloud-core/actor.js" +import { getRequestEvent } from "solid-js/web" const getUserInfo = query(async (workspaceID: string) => { "use server" @@ -17,12 +18,14 @@ const getUserInfo = query(async (workspaceID: string) => { const logout = action(async () => { "use server" const auth = await useAuthSession() + const event = getRequestEvent() const current = auth.data.current if (current) await auth.update((val) => { delete val.account?.[current] const first = Object.keys(val.account ?? {})[0] val.current = first + event!.locals.actor = undefined return val }) }) |
