Cleaning up, enforcing username constraints to match profile page settings. Added uniqueness to profile username.

This commit is contained in:
terakilobyte
2015-01-09 22:05:45 -05:00
parent 11bc776ffb
commit b4395e2b59
4 changed files with 23 additions and 12 deletions

View File

@ -189,9 +189,7 @@ exports.checkUniqueUsername = function(req, res) {
*/
exports.checkUniqueEmail = function(req, res) {
console.log(req.params.email);
User.count({'email': decodeURIComponent(req.params.email).toLowerCase()}, function (err, data) {
console.log(User.findOne({'email': decodeURIComponent(req.params.email)}));
if (data == 1) {
return res.send(true);
} else {