code: function createNewUser(req, res, err, user, options) {
  	if (err) {
  		logger.error(req.url, err);
  		return api.writeError(500, res, "An internal error has occured");
  	}
  	if (user) {
  		if (user.__newUser) {
  			if (!canAddUsers(options)) {
  				let errorUrl = "/mixloginstatic/LoginWindow.html?error=" +
  					new Buffer("There is no Orion account associated with this Id. Please register or contact your system administrator for assistance.").toString('base64');
  				return res.redirect(errorUrl);
  			}
  			let registerUrl = "/mixloginstatic/LoginWindow.html";
  			registerUrl += "?oauth=create&email=" + user.email;
  			registerUrl += "&username=" + user.username;
  			registerUrl += "&identifier=" + user.id;
  			return res.redirect(registerUrl);
  		} else if (user.__linkUser) {
  			return api.writeResponse(200, res, null, "<html><head></head><body onload=\"window.opener.handleOAuthResponse('" + user.id + "');window.close();\"></body></html>");
  		}
  	}
  	doLogin(req, user, function(err) {
  		if (err) {
  			return api.writeError(500, res, "Problem logging in");
  		}
  		return res.redirect("/");
  	});
  }
docs: Creates a new user
  @param {XMLHttpRequest} req The original request
  @param {XMLHttpResponse} res The rsponse object
  @param {Error} err The caller error, or null
  @param {{?}} user The user metadata
  @param {{?}} options Map of server options