diff --git a/src/models/userModel.js b/src/models/userModel.js index b7bba27..f47225c 100644 --- a/src/models/userModel.js +++ b/src/models/userModel.js @@ -35,6 +35,9 @@ export const getDbUser = async (objId) => { } export const updateDbUser = async (obj, objId) => { + if (obj.email) { + delete obj.email // prevent email field from being saved in users collection + } try { const userRef = firestore.collection('users').doc(objId || obj.id) await userRef.update(obj)