Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User Sign out callback in Meteor

In my project I need to call a callback function on User -> Sign out in order to set as 'null' a Session value.

Is there a way to override Meteor.logout() behavior? How to provide that callback function?

Thanks

like image 890
redbaron76 Avatar asked Feb 18 '13 11:02

redbaron76


1 Answers

Meteor.logout() has a callback function.

http://docs.meteor.com/#meteor_logout

Meteor.logout(function(err) {
  // callback
  Session.set("ses",false);
});

--

Template.tplName.events
  "click #logout": (e, tmpl) ->
    Meteor.logout ->
      Session.set "ses", false
like image 106
Suburbio Avatar answered Sep 25 '22 17:09

Suburbio