added preferences to pull from user_preferences collection. seems to be working.
This commit is contained in:
+7
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user