redbaron76
redbaron76

Reputation: 357

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

Upvotes: 8

Views: 11672

Answers (1)

Suburbio
Suburbio

Reputation: 604

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

Upvotes: 22

Related Questions