“Login Forbidden” when using Meteor's Accounts.validateLoginAttempt(func)

我是研究僧i 提交于 2019-12-24 00:35:23

问题


I have a basic Meteor method that I am trying to call whenever the user attempts to sign in.

Accounts.validateLoginAttempt(function (options) {
   Meteor.call('method', true, function (error, result) { 
     // do nothing
  });
});

However, whenever I try to sign in, I receive "Login Forbidden" as an error. The same happens upon sign up. I am guessing I need to be returning something for the function, but do not know what. Your help would be greatly appreciated!


回答1:


From the docs http://docs.meteor.com/#/full/accounts_validateloginattempt

A validate login callback must return a truthy value for the login to proceed. 

In the block do some validations like if user is verified or not and return true or false to complete the login process.



来源:https://stackoverflow.com/questions/27585752/login-forbidden-when-using-meteors-accounts-validateloginattemptfunc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!