trailsjs / sails-auth

Passport-based User Authentication system for sails.js applications. Designed to work well with the sails-permissions module.
https://www.npmjs.org/package/sails-auth
MIT License
266 stars 141 forks source link

unique: true works bad with sails-mongo. #145

Open misterjt opened 8 years ago

misterjt commented 8 years ago

I happened to notice on my production server that i can create several users with the same username or emails. I use mongodb on this server. I started to google, and found, that sails-mongo almost not working with unique:true. Сould you please implement an additional check on the uniqueness of username and email?

tjwebb commented 8 years ago

You can extend the models to add whichever constraints you wish. If you'd like to add this to the core, please submit a PR