Skip to content

Commit

Permalink
Feature/sd 506 enable basic auth (#570)
Browse files Browse the repository at this point in the history
* Shield module added in tide_core

* Enable shield module in tide core

* revert file to as on develop

---------

Co-authored-by: sharmasahil <[email protected]>
  • Loading branch information
sharmasahil and sharmasahil authored Jan 6, 2025
1 parent beee018 commit 571bb5e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
20 changes: 20 additions & 0 deletions tide_core.install
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit 571bb5e

Please sign in to comment.