Logging in to Meteor - logging off ~ hook / callback

Using this package in MeteorJS accounts-google , I tried to find the right approach to have a callback after logging in and logging out. I am currently using the hook below to login (which seems to me too simplistic - I want to find the hook caused by the callback after successful authentication) ~ and am still not sure how to do this to log out.

Meteor.autorun(function() { if (Meteor.user()) { //code for login } }

+6
source share
1 answer

UPDATE: Now there is an onLogout binding


From what I saw, there are no hooks for the registered event, but there is one for the registered event:

Accounts.onLogin (func)

An onLoggedOut hook has been added to the event-hooks package.

You can also do something like this:

 Meteor.autorun(function () { if (Meteor.userId()) { do something when logged in } else { do something when logged out } }); 
+8
source

All Articles