adds user management

This commit is contained in:
Christian Beutel
2024-02-02 22:48:24 +01:00
parent 99f743ec94
commit 905995a01c
60 changed files with 1135 additions and 128 deletions

8
web/src/hooks.client.ts Normal file
View File

@@ -0,0 +1,8 @@
import { pb } from '$lib/pocketbase'
import { currentUser } from '$lib/stores/user_store'
pb.authStore.loadFromCookie(document.cookie)
pb.authStore.onChange(() => {
currentUser.set(pb.authStore.model)
document.cookie = pb.authStore.exportToCookie({ httpOnly: false })
}, true)