Strange issue, I have a function that trigger by Firebase newUser auth if the user uses Google or Facebook provider the function works but if it email/password signup the function returns an undefined error. what I'm missing here?
The function code:
exports.newUser = functions.auth.user().onCreate((user) => {
const docRef = admin.firestore().collection('Users').doc(user.uid)
return docRef.set({
email: user.email,
name: '',
photo: '',
signupDate: admin.firestore.FieldValue.serverTimestamp()
},{merge: true});
});