问题
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