Skip to content

Commit ff89305

Browse files
committed
wip: logout
1 parent 605f789 commit ff89305

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cloud/app/src/routes/workspace.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { withActor } from "~/context/auth.withActor"
44
import { query, action, redirect, createAsync, RouteSectionProps, Navigate, useNavigate, useParams, A } from "@solidjs/router"
55
import { User } from "@opencode/cloud-core/user.js"
66
import { Actor } from "@opencode/cloud-core/actor.js"
7+
import { getRequestEvent } from "solid-js/web"
78

89
const getUserInfo = query(async (workspaceID: string) => {
910
"use server"
@@ -17,12 +18,14 @@ const getUserInfo = query(async (workspaceID: string) => {
1718
const logout = action(async () => {
1819
"use server"
1920
const auth = await useAuthSession()
21+
const event = getRequestEvent()
2022
const current = auth.data.current
2123
if (current)
2224
await auth.update((val) => {
2325
delete val.account?.[current]
2426
const first = Object.keys(val.account ?? {})[0]
2527
val.current = first
28+
event!.locals.actor = undefined
2629
return val
2730
})
2831
})

0 commit comments

Comments
 (0)