Search code examples
meteor

Block certain users from login using Meteor's accounts-password


New Meteor user here. I would like to block former employees from being able to login to a Meteor web app. The login is implemented by the accounts-password package. Does it provide an API to do this easily, if I don't want to delete the users or manually change their password from the database?

I tried to look through Meteor's documentation but found no luck.


Solution

  • You could define a validateLoginAttempt function that checks a custom field in the user document, e.g., disabled, and return false accordingly.