Updated schema
This commit is contained in:
@ -33,9 +33,12 @@ exports.postSignup = function(req, res) {
|
|||||||
password: req.body.password
|
password: req.body.password
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(req.body);
|
||||||
|
|
||||||
// TODO: add User.schema.path validation
|
// TODO: add User.schema.path validation
|
||||||
// TODO: check if user already exists in user.save() by catching that error
|
// TODO: check if user already exists in user.save() by catching that error
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
|
if (err) throw err;
|
||||||
console.log('New user created');
|
console.log('New user created');
|
||||||
req.login(user, function(err) {
|
req.login(user, function(err) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
|
Reference in New Issue
Block a user