I assume that you are using the Meteor Accounts package, as you did not specify otherwise. You can override the Accounts.validateLoginAttempt ( docs ) function to throw a Meteor.Error . As written in the docs:
Verifying that the login is correct should return a valid value for the login. > If the callback returns a fake value or throws an exception, the login> is canceled. Throwing Meteor.Error will Meteor.Error user of the error.
source share