feat: refresh auth when page reload
This commit is contained in:
parent
ba61a60192
commit
09363c9df3
1 changed files with 5 additions and 0 deletions
|
|
@ -4,6 +4,11 @@ export const pb = new PocketBase("http://localhost:8090");
|
|||
|
||||
let user = $state(pb.authStore.model);
|
||||
|
||||
if (user) {
|
||||
await pb.collection("users").authRefresh();
|
||||
console.log("refresh");
|
||||
}
|
||||
|
||||
pb.authStore.onChange(() => {
|
||||
user = pb.authStore.model;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue