From af58c91fc30f70ac2847af387f2826c2b93e186e Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Wed, 18 Oct 2023 11:37:25 +0200 Subject: [PATCH] fix: move publisher consumer initialization to a deploy hook As the role configuration is not available yet on the install hook. --- ...auth.install => silverback_gatsby_oauth.deploy.php} | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) rename packages/composer/amazeelabs/silverback_gatsby/modules/silverback_gatsby_oauth/{silverback_gatsby_oauth.install => silverback_gatsby_oauth.deploy.php} (87%) diff --git a/packages/composer/amazeelabs/silverback_gatsby/modules/silverback_gatsby_oauth/silverback_gatsby_oauth.install b/packages/composer/amazeelabs/silverback_gatsby/modules/silverback_gatsby_oauth/silverback_gatsby_oauth.deploy.php similarity index 87% rename from packages/composer/amazeelabs/silverback_gatsby/modules/silverback_gatsby_oauth/silverback_gatsby_oauth.install rename to packages/composer/amazeelabs/silverback_gatsby/modules/silverback_gatsby_oauth/silverback_gatsby_oauth.deploy.php index 98a620a92..163724f35 100644 --- a/packages/composer/amazeelabs/silverback_gatsby/modules/silverback_gatsby_oauth/silverback_gatsby_oauth.install +++ b/packages/composer/amazeelabs/silverback_gatsby/modules/silverback_gatsby_oauth/silverback_gatsby_oauth.deploy.php @@ -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. @@ -57,5 +60,8 @@ function silverback_gatsby_oauth_install() { 'publisher', ], ])->save(); + return t('Created Publisher OAuth Consumer.'); } + + return t('Publisher OAuth Consumer already exists.'); }