Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = exports = function(req, res, next) {
- User.find({ username: req.body.username }, (err, user) => {
- if (err) return handleDBError(err, res);
- if (user) return res.status(200).json({ msg: 'an account with this username already exists' });
- });
- next();
- };
- var userSchema = new mongoose.Schema({
- username: String,
- authentication: {
- email: String,
- password: String
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement