lib/controllers/register.js
function applyDefaultAccountFields(stormpathConfig, req) {
  var registerFields = stormpathConfig.web.register.form.fields;

  if ((!registerFields.givenName || !registerFields.givenName.required || !registerFields.givenName.enabled) && !req.body.givenName) {
    req.body.givenName = 'UNKNOWN';
  }

  if ((!registerFields.surname || !registerFields.surname.required || !registerFields.surname.enabled) && !req.body.surname) {
    req.body.surname = 'UNKNOWN';
  }
}
function applyDefaultAccountFields(stormpathConfig, req) {
  var registerFields = stormpathConfig.web.register.form.fields;

  if ((!registerFields.givenName || !registerFields.givenName.required || !registerFields.givenName.enabled) && !req.body.givenName) {
    req.body.givenName = 'UNKNOWN';
  }

  if ((!registerFields.surname || !registerFields.surname.required || !registerFields.surname.enabled) && !req.body.surname) {
    req.body.surname = 'UNKNOWN';
  }
}
function applyDefaultAccountFields ( stormpathConfig , req ) { var registerFields = stormpathConfig . web . register . form . fields ; if ( ( ! registerFields . givenName || ! registerFields . givenName . required || ! registerFields . givenName . enabled ) && ! req . body . givenName ) { req . body . givenName = 'UNKNOWN' ; } if ( ( ! registerFields . surname || ! registerFields . surname . required || ! registerFields . surname . enabled ) && ! req . body . surname ) { req . body . surname = 'UNKNOWN' ; } }
The Stormpath API requires the `givenName` and `surname` fields to be
provided, but as a convenience our framework integrations allow you to
omit this data and fill those fields with the string `UNKNOWN` - but only
if the field is not explicitly required.

@function

@param {Object} stormpathConfig - The express-stormpath configuration object
@param {Object} req - The http request.
The Stormpath API requires the givenName and surname fields to be provided but as a convenience our framework integrations allow you to omit this data and fill those fields with the string UNKNOWN - but only if the field is not explicitly required .