Using the following code I am managing login on my site, however to keep things dry and not needing to have multiple mutation functions on my client-side for the user object, how can I return custom data in the user object within Metoer.loginWithPassword? (I have a subscription running for the custom data, but it’s obviously not ready until after the login…)
Example.
Meteor.loginWithPassword(username, password, function (error) {
if (!error) {
let authenticated = true;
let user = Meteor.user(); //custom data like user.name isn't available and I need it
dispatch(types.CONFIG_USER_AUTH, authenticated, user, "Login Success : Debug: #login");
} else {
console.log(error)
}
});
};