How to get Meteor registration event response with ui accounts?

I use accounts-uiwith {{> loginButtons}}for registration and login functions. After registering the user, I want to get a response along with the user data. How can I get a response to a registration event?

+4
source share
1 answer

You can use a accountsServer.onCreateUser(func)hook that will be called whenever a new user is created:

if (Meteor.isServer) {
    Accounts.onCreateUser(function(options, user) {
        console.log(user);
        return user;
    });
}

The returned userwill be inserted into the collection Meteor.users.

Here is the MeteorPad .

+1
source

Source: https://habr.com/ru/post/1608436/


All Articles