Reputation: 1293
After an user creation, I have difficult to retrived data in a onCreate method.
exports.accountCreate = functions.auth.user().onCreate(user => {
console.log("--->"+user.data);
console.log("ok");
return true;
});
But I received an undefined value
Upvotes: 1
Views: 171
Reputation: 317467
As you can see in the API documentation, the onCreate callback method receives a UserRecord object as its first argument. Your function is calling it user
, and is trying to access a property called data
on it. But you can see that UserRecord doesn't have a data property. It has lots of other properties, so try one of them instead. Or maybe call its toJSON method to generate an object that you could also log.
Upvotes: 2