This commit is contained in:
Henry Dollman
2024-07-08 23:20:42 -04:00
parent 7b4e2d9441
commit 04c14ad4ab
10 changed files with 432 additions and 169 deletions

View File

@@ -1,3 +1,14 @@
import PocketBase from 'pocketbase'
import { atom } from 'nanostores'
import { SystemRecord } from '@/types'
export const pb = new PocketBase('/')
// @ts-ignore
pb.authStore.storageKey = 'pb_admin_auth'
export const $authenticated = atom(pb.authStore.isValid)
export const $servers = atom([] as SystemRecord[])
pb.authStore.onChange(() => {
$authenticated.set(pb.authStore.isValid)
})