diff --git a/.DS_Store b/.DS_Store index 711a192a..7be137e7 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/composer.json b/composer.json index f2c32c97..990c0a41 100644 --- a/composer.json +++ b/composer.json @@ -121,6 +121,7 @@ "jquery/inputmask": "5.0.8", "jquery/intl-tel-input": "17.0.19", "progress-tracker/progress-tracker": "2.0.7", + "drupal/shield": "^1.8", "drupal/media_alias_display": "^2.1" }, "repositories": { diff --git a/tide_core.install b/tide_core.install index 79171eb9..05ce6911 100644 --- a/tide_core.install +++ b/tide_core.install @@ -358,3 +358,23 @@ function tide_core_update_10011() { } } } + +/** + * Enable shield module. + */ +function tide_core_update_10012() { + // Check if the shield module is disabled, enable it. + if (\Drupal::moduleHandler()->moduleExists('shield') === FALSE) { + \Drupal::service('module_installer')->install(['shield']); + } + // Add the new paths to exclude. + $exclude_paths = [ + '/oauth', + '/oauth/authorize', + '/oauth/token', + '/sites/default/files/*', + ]; + $paths_string = implode("\r\n", $exclude_paths); + $shield_config = \Drupal::configFactory()->getEditable('shield.settings'); + $shield_config->set('paths', $paths_string)->save(); +}