Store Google avatar bytes and slim the session JWT to id only.
Download profile images on login into picturebinary, return them as base64 from /auth/me, and resolve sessions via getById.
This commit is contained in:
@@ -11,6 +11,11 @@ export async function getAllowedEmail(email) {
|
||||
return (await store.google_auth.getByEmail(normalized)) ?? null;
|
||||
}
|
||||
|
||||
export async function getById(authId) {
|
||||
const store = await getStore();
|
||||
return (await store.google_auth.getById(authId)) ?? null;
|
||||
}
|
||||
|
||||
export async function addAllowedEmail(email) {
|
||||
const normalized = email.trim().toLowerCase();
|
||||
const store = await getStore();
|
||||
@@ -32,7 +37,7 @@ export async function setSelectedCompany(authId, companyId) {
|
||||
await store.google_auth.setSelectedCompany(authId, companyId);
|
||||
}
|
||||
|
||||
export async function setProfile(authId, { picture = null, sub = null } = {}) {
|
||||
export async function setProfile(authId, { picture = null, pictureBinary = null, sub = null } = {}) {
|
||||
const store = await getStore();
|
||||
await store.google_auth.setProfile(authId, { picture, sub });
|
||||
await store.google_auth.setProfile(authId, { picture, pictureBinary, sub });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user