diff --git a/oauth2_server.info.yml b/oauth2_server.info.yml index db1ac72..c6639a5 100644 --- a/oauth2_server.info.yml +++ b/oauth2_server.info.yml @@ -2,5 +2,5 @@ name: OAuth2 Server type: module description: 'Provides OAuth2 server functionality.' package: OAuth2 -core_version_requirement: ^8.8 || ^9 +core_version_requirement: ^8.8 || ^9 || ^10 configure: oauth2_server.overview diff --git a/oauth2_server.module b/oauth2_server.module index fe0deea..b421082 100644 --- a/oauth2_server.module +++ b/oauth2_server.module @@ -20,6 +20,7 @@ function oauth2_server_cron() { $query = \Drupal::entityQuery($entity_type); $query->condition('expires', 0, '<>'); $query->condition('expires', $request_time, '<='); + $query->accessCheck(TRUE); $result = $query->execute(); if ($result) { diff --git a/src/ScopeUtility.php b/src/ScopeUtility.php index 5c73602..928682b 100644 --- a/src/ScopeUtility.php +++ b/src/ScopeUtility.php @@ -123,7 +123,7 @@ class ScopeUtility implements OAuth2ScopeInterface { public function getDefaultScope($client_id = NULL) { // Allow any hook_oauth2_server_default_scope() implementations to supply // the default scope. The first one to return a scope wins. - foreach (\Drupal::moduleHandler()->getImplementations('oauth2_server_default_scope') as $module) { + foreach (\Drupal::moduleHandler()->invokeAll('oauth2_server_default_scope') as $module) { $function = $module . '_' . 'oauth2_server_default_scope'; $args = [$this->server]; $result = call_user_func_array($function, $args); diff --git a/src/Utility.php b/src/Utility.php index c4293b4..859b061 100644 --- a/src/Utility.php +++ b/src/Utility.php @@ -116,7 +116,7 @@ class Utility { * - public_key: The generated public key certificate (PEM encoded X.509). */ public static function generateKeys() { - $module_path = drupal_get_path('module', 'oauth2_server'); + $module_path = \Drupal::service('extension.list.module')->getPath('oauth2_server'); $module_realpath = \Drupal::service('file_system')->realpath($module_path); $config = [ 'config' => $module_realpath . DIRECTORY_SEPARATOR . 'oauth2_server.openssl.cnf',