Advertisement
Guest User

Untitled

a guest
Jan 28th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. module.exports = exports = function(req, res, next) {
  2. User.find({ username: req.body.username }, (err, user) => {
  3. if (err) return handleDBError(err, res);
  4. if (user) return res.status(200).json({ msg: 'an account with this username already exists' });
  5. });
  6. next();
  7. };
  8.  
  9. var userSchema = new mongoose.Schema({
  10. username: String,
  11. authentication: {
  12. email: String,
  13. password: String
  14. }
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement