[SOLVED] Server hook when user logs in

Wondering if someone could give me some advice. I thought this would be fairly easy, but the answer is alluding me in the docs at the moment.

I have some server functions that I’m looking to run when a user logs in. I have some account maintenance that I would like to perform every time a user visits the site. Like update their account records if necessary.

Doe anyone have any advice on the best way to do this? The best Meteor hook on the server that will run when a user logs in?


Accounts onLogin hook is probably what you’re looking for.

1 Like

Perfect! Thanks so much. I missed that, the Multi Server title through me off. Appreciate it!

1 Like

You’re very welcome!

As far as Multi Server is concerned, I’ve never quite understood the name myself, but the reasoning for the differentiation as far as I can tell is because all the methods under the the “Accounts” section pertain to account methods that are exposed on the Meteor object, such as Meteor.logout() or Meteor.loginWithPassword(), and pertain to managing a particular user. Everything under "Accounts (multi-server) section is more general parts of the accounts system and are exposed on the Accounts object.

1 Like

Happened to me as well. It’s pretty misleading.