Created username availability controller

This commit is contained in:
Sahat Yalkabov
2013-12-18 15:00:33 -05:00
parent b0390941f1
commit b98bf72107

View File

@ -154,6 +154,24 @@ exports.postSignup = function(req, res) {
}); });
}; };
/**
* POST /signup/available
* Checks if current username is available
*/
exports.postAvailability = function(req, res) {
User.findOne({ username: req.body.username }, function(err, user) {
if (user) {
// unavailable
// has-error
return;
} else {
// username is available
// has-success
return;
}
});
};
/** /**
* GET /account/unlink/:provider * GET /account/unlink/:provider