Skip to content

Commit

Permalink
fix: move publisher consumer initialization to a deploy hook
Browse files Browse the repository at this point in the history
As the role configuration is not available yet on the install hook.
  • Loading branch information
colorfield committed Oct 18, 2023
1 parent b22387e commit af58c91
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

use Drupal\user\RoleInterface;

function silverback_gatsby_oauth_install() {
/**
* Set up the Publisher OAuth Consumer.
*/
function silverback_gatsby_oauth_deploy_set_consumers(array &$sandbox): string {
// Skip for Silverback environments.
// It might be used for OAuth development purpose only in Silverback
// and can be set manually for this case.
// Matches the default Publisher behavior
// that disables Publisher OAuth for non Lagoon environments.
if (getenv('SB_ENVIRONMENT')) {
return;
return t('Skipping for Silverback environment.');
}

// Check requirements.
Expand Down Expand Up @@ -57,5 +60,8 @@ function silverback_gatsby_oauth_install() {
'publisher',
],
])->save();
return t('Created Publisher OAuth Consumer.');
}

return t('Publisher OAuth Consumer already exists.');
}

0 comments on commit af58c91

Please sign in to comment.