Add pocketbase util

This commit is contained in:
2025-11-14 09:57:07 +13:00
parent bd746f4e75
commit e930e75646
7 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import PocketBase from "pocketbase";
const pb = new PocketBase("/");
export const authPB = async () => {
if (!pb.authStore.isValid) {
await pb.collection('users').authWithPassword(
import.meta.env.PB_EMAIL,
import.meta.env.PB_PW
);
}
return pb;
};