1

我正在尝试使用 SmartPackage accounts-anonymous,它使用的是看起来像旧 API 的东西:

Meteor.accounts.registerLoginHandler(...)

对于较新的(在dougnukem/meteor-accounts-anonymous分叉):

Accounts.registerLoginHandler(...)

但是当使用标准的 accounts-ui 包时,它只是说:

未配置登录服务

然后当我连接一个按钮来强制匿名登录时:

  Template.hello.events({
    'click input' : function () {
      // LOGIN ANONYMOUSLY
      Meteor.loginAnonymously();
      // template data, if any, is available in 'this'
      if (typeof console !== 'undefined') {
        console.log("You pressed the button");
        console.log("LOGGED IN ANONYMOUSLY AS: " + Meteor.userId());
      }
    }
  });

我收到一个错误:

Exception while invoking method 'login' TypeError: Object #<Object> has no method 'onCreateUserHook'
    at app/packages/accounts-anonymous/anonymous_server.js:10:25
    at tryAllLoginHandlers (app/packages/accounts-base/accounts_server.js:33:25)
    at _.find._.detect (app/packages/underscore/underscore.js:142:20)
    at Array.some (native)
    at _.some._.any (app/packages/underscore/underscore.js:193:59)
    at Function._.find._.detect (app/packages/underscore/underscore.js:141:5)
    at tryAllLoginHandlers (app/packages/accounts-base/accounts_server.js:31:7)
    at Meteor.methods.login (app/packages/accounts-base/accounts_server.js:12:20)
    at app/packages/livedata/livedata_server.js:298:30
    at _.extend.withValue (app/packages/meteor/dynamics_nodejs.js:31:19)
4

0 回答 0