You are here

function drupalauth4ssp_post_update_add_authsource_param in DrupalAuth for SimpleSAMLphp 8

Add the authsource configuration parameter.

File

./drupalauth4ssp.post_update.php, line 11
Post update hooks for drupalauth4ssp.

Code

function drupalauth4ssp_post_update_add_authsource_param() {
  $config = \Drupal::service('config.factory')
    ->getEditable('drupalauth4ssp.settings');
  if (!$config
    ->get('authsource')) {
    $config
      ->set('authsource', 'drupal-userpass')
      ->clear('cookie_name')
      ->save();
  }
}