Allow changing fallbackEmail via the profile api

This commit is contained in:
Johannes Zellner
2018-01-22 15:55:55 +01:00
parent cf94f26d62
commit 9f29438b34
2 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -36,9 +36,10 @@ function update(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
if ('email' in req.body && typeof req.body.email !== 'string') return next(new HttpError(400, 'email must be string'));
if ('fallbackEmail' in req.body && typeof req.body.fallbackEmail !== 'string') return next(new HttpError(400, 'fallbackEmail must be string'));
if ('displayName' in req.body && typeof req.body.displayName !== 'string') return next(new HttpError(400, 'displayName must be string'));
var data = _.pick(req.body, 'email', 'displayName');
var data = _.pick(req.body, 'email', 'fallbackEmail', 'displayName');
user.update(req.user.id, data, auditSource(req), function (error) {
if (error && error.reason === UserError.BAD_FIELD) return next(new HttpError(400, error.message));