code: function resetPassword(req, res, options, err, user) {
  	if (err || !user) {
  		return api.writeError(404, res, "User " +  (req.body.UserName || req.body.Email) + " not found");
  	}
  	if (!emailConfirmed(user)) {
  		return api.writeError(400, res, "Email confirmation has not completed. Please follow the instructions from the confirmation email in your inbox and then request a password reset again.");
  	}
  	crypto.randomBytes(AUTH_TOKEN_BYTES, function(randomBytes) {
  		fileUtil.getMetastoreSafe().then(function(store) {
  			store.updateUser(user.username, { authToken: randomBytes }, function(err, user) {
  				if (err) {
  					logger.error(err);
  					return api.writeError(500, res,  "Error updating user");
  				}
  				const emailUrl = getEmaillUrl(user.username, PASSWORD_QUERY_PARAM);
  				return sendMail({user: user, options: options, template: PWD_CONFIRM_RESET_MAIL, auth: emailUrl, req: req}, /* @callback */ function(err, info) {
  					if(err) {
  						return api.writeError(500, res, err);
  					}
  					return api.writeResponse(200, res, null, {"Severity":"Info","Message":"Confirmation email has been sent.","HttpCode":200,"BundleId":"org.eclipse.orion.server.core","Code":0});
  				});
  			});
  		});
  	});
  }
docs: Reset the password for the given user / request
  @param {XMLHttpRequest} req The original request
  @param {XMLHttpResponse} res The response object
  @param {{?}} options The map of server options
  @param {Error} err The error from the caller or null
  @param {{?}} user The user metadata