8

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

om-nom-nom
  • 62,329
  • 13
  • 183
  • 228
redbaron76
  • 357
  • 1
  • 5
  • 13

1 Answers1

22

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
Suburbio
  • 604
  • 3
  • 4