daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Jan 28th, 2016 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top