diff --git a/Taskfile.yml b/Taskfile.yml index 401ab912e..792a69e00 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -382,6 +382,11 @@ tasks: cmds: - cmd: task dev:cli -- drush default-content:export-module dpl_example_content + dev:dpl-go:get-graphql-credentials: + desc: Get the GraphQL credentials from the site + cmds: + - cmd: task dev:cli -- drush php-eval "dpl_consumers_print_consumer_credentials()" + ci:reset: desc: Create CI setup in a clean state cmds: diff --git a/web/modules/custom/dpl_consumers/dpl_consumers.module b/web/modules/custom/dpl_consumers/dpl_consumers.module new file mode 100644 index 000000000..76e7d7e5d --- /dev/null +++ b/web/modules/custom/dpl_consumers/dpl_consumers.module @@ -0,0 +1,40 @@ +getStorage('consumer') + ->loadByProperties(['client_id' => $client_id]); + + if (!empty($consumer)) { + $consumer = reset($consumer); + return $consumer->uuid(); + } + } + catch (\Exception $e) { + \Drupal::logger('dpl_consumers')->error($e->getMessage()); + return 'Consumer not found.'; + } +}