Currently, I am delving into the realm of Cloud Functions for Firebase and have successfully implemented an auth trigger by following a tutorial. However, I am now facing a challenge in passing the username
that the user desires to use to my auth event. I am uncertain if I selected the incorrect trigger and whether an HTTP trigger would have been more suitable?
exports.newUserSignup = functions.auth.user().onCreate(user => {
console.log('user created', user.email, user.uid);
const doc = admin.firestore().collection('users').doc();
return doc.set({
createDate: admin.firestore.FieldValue.serverTimestamp(),
modifiedDate: admin.firestore.FieldValue.serverTimestamp(),
username: 'NEED TO FIGURE THIS OUT',
email: user.email,
stat: 1,
uid: user.uid,
rowpointer: doc.id,
});
});