final flows including emails for passwords
This commit is contained in:
@@ -5,11 +5,15 @@ export const pb = new PocketBase(PB_ENDPOINT);
|
||||
pb.autoCancellation(false);
|
||||
|
||||
// Seed the browser PB singleton with the session token so shared stores can
|
||||
// do authenticated reads + realtime .subscribe() from the client.
|
||||
// do authenticated reads + realtime .subscribe() from the client. When the
|
||||
// session is gone (logged out), clear the authStore — the default LocalAuthStore
|
||||
// persists the token in localStorage, so without this the client keeps an
|
||||
// authenticated singleton and effectively stays logged in.
|
||||
export function initRealtimePb(token: string) {
|
||||
if (token) {
|
||||
pb.authStore.save(token, null);
|
||||
return true;
|
||||
}
|
||||
pb.authStore.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user