code: function validateNewCredentialProperties (credentialConfig, credentialDetail) {
    // Tmp — horrible hack to remove.
    const credentialDetails = JSON.parse(JSON.stringify(credentialDetail));
    delete credentialDetails.scopes;
  
    const validationResult = validate(credentialConfig, credentialDetails);
    if (!validationResult.isValid) {
      return Promise.reject(new Error(validationResult.error));
    };
  
    return Promise.resolve(credentialDetails);
  }
docs: This function validates all user defined properties, excluding scopes