add blacklisted usernames to loopback user validations
This commit is contained in:
@ -10,6 +10,12 @@ module.exports = function(User) {
|
|||||||
delete User.validations.email;
|
delete User.validations.email;
|
||||||
// set salt factor for passwords
|
// set salt factor for passwords
|
||||||
User.settings.saltWorkFactor = 5;
|
User.settings.saltWorkFactor = 5;
|
||||||
|
|
||||||
|
User.validatesExclusionOf('username', {
|
||||||
|
inArray: blacklistedUsernames,
|
||||||
|
message: 'username is taken'
|
||||||
|
});
|
||||||
|
|
||||||
debug('setting up user hooks');
|
debug('setting up user hooks');
|
||||||
// send verification email to new camper
|
// send verification email to new camper
|
||||||
User.afterRemote('create', function(ctx, user, next) {
|
User.afterRemote('create', function(ctx, user, next) {
|
||||||
|
Reference in New Issue
Block a user