added preferences to pull from user_preferences collection. seems to be working.

This commit is contained in:
2025-12-17 19:58:39 +00:00
parent 1d692ddb87
commit 560e30d93c
2 changed files with 121 additions and 15 deletions
+7 -1
View File
@@ -20,6 +20,12 @@
);
}
function getEmail() {
const model = pb.authStore.model || {};
// Prefer email, but fall back to username if email missing
return model.email || model.username || null;
}
async function ensureAuth() {
if (pb.authStore.isValid) return true;
const path = new URL(window.location.href).pathname;
@@ -29,5 +35,5 @@
return false;
}
global.Auth = { pb, authHeaders, ensureAuth, getDisplayName };
global.Auth = { pb, authHeaders, ensureAuth, getDisplayName, getEmail };
})(window);