【问题标题】:User Sign out callback in MeteorMeteor 中的用户注销回调
【发布时间】:2013-02-18 20:26:26
【问题描述】:

在我的项目中,我需要在 User 上调用回调函数 -> 注销才能将 Session 值设置为“null”。

有没有办法覆盖Meteor.logout() 的行为? 如何提供那个回调函数?

谢谢

【问题讨论】:

标签: javascript meteor


【解决方案1】:

Meteor.logout() 有一个回调函数。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-17
    • 1970-01-01
    • 1970-01-01
    • 2021-11-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多