Update lambda/index.js

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
This commit is contained in:
Adam Moussa 2026-05-11 13:58:38 -04:00 • committed by GitHub
parent 5e15036e51
commit b0e047e5a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -148,9 +148,7 @@ function extractUserFields(googleUser) {
if (googleUser.phones && googleUser.phones.length > 0) { if (googleUser.phones && googleUser.phones.length > 0) {
const workPhone = googleUser.phones.find((p) => p.type === "work" && p.value); const workPhone = googleUser.phones.find((p) => p.type === "work" && p.value);
const primaryPhone = googleUser.phones.find((p) => p.primary && p.value) || googleUser.phones.find((p) => p.value); const primaryPhone = googleUser.phones.find((p) => p.primary && p.value) || googleUser.phones.find((p) => p.value);
phone = (workPhone || primaryPhone || {}).value || ""; phone = (workPhone && workPhone.value) || primaryPhone.value || "";
}
return { email, jobTitle, phone }; return { email, jobTitle, phone };
} }