Adjust api to set a flag if invitiation should be sent on user creation

This commit is contained in:
Johannes Zellner
2016-01-18 13:48:10 +01:00
parent 2edd434474
commit 8ac27b9dc7
2 changed files with 5 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ function createUser(req, res, next) {
var password = generatePassword(8, true /* memorable */);
var email = req.body.email;
user.create(username, password, email, false /* admin */, req.user /* creator */, function (error, user) {
user.create(username, password, email, false /* admin */, req.user /* creator */, true /* sendInvite */, function (error, user) {
if (error && error.reason === UserError.BAD_USERNAME) return next(new HttpError(400, 'Invalid username'));
if (error && error.reason === UserError.BAD_EMAIL) return next(new HttpError(400, 'Invalid email'));
if (error && error.reason === UserError.BAD_PASSWORD) return next(new HttpError(400, 'Invalid password'));