This commit is contained in:
Dax Raad
2025-09-02 18:00:48 -04:00
parent e544cccc70
commit 2e16d685eb
6 changed files with 20 additions and 18 deletions

View File

@@ -23,10 +23,10 @@ const logout = action(async () => {
if (current)
await auth.update((val) => {
delete val.account[current]
const first = Object.keys(val.account)[0]
val.current = first
return val
})
return redirect("/")
})
export default function WorkspaceLayout(props: RouteSectionProps) {
@@ -43,7 +43,7 @@ export default function WorkspaceLayout(props: RouteSectionProps) {
</div>
<div data-slot="header-actions">
<span>{userInfo()?.user.email}</span>
<form action={logout} method="post">
<form onSubmit={() => location.href = "/"} action={logout} method="post">
<button type="submit" formaction={logout}>Logout</button>
</form>
</div>