Hooks.onLoggedOut = function (userId) {
var u = Meteor.users.findOne({_id: userId});
if(u)
{
console.log('Logged out user '+userId+'. Number of login tokens: '+u.services.resume.loginTokens.length);
Meteor.users.update({_id: userId},{$set:{"services.resume.loginTokens":[]}});
}
};
--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meteor-talk...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Jan,AFAIK, this exists and have no official solution yet.Removing loginTokens at the logout can have some bad effects since it will remove all the tokens.Some users may loggedin using several browser so have several tokens. Deleting all loginToken when loggedOut will loggedOut him from every browser.
This may be a feature or a bug depending your app.
Another way to deal with this is a use a cron job to remove older tokens. Each token contains a timestamp value.There is another way we can dealwith this. But complex. Using a loginHandler.Hope this helps you out.
--
What may be interesting is for users to be able to reset login tokens across all devices/sessions similar to how Google Apps works. Which of course would open up the methods to handle it server side and/or from an admin panel one might build.