From 12deb7946e66dcdfaa5b3da669db4929263d717f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jind=C5=99ich=20Na=C4=8Deradsk=C3=BD?= Date: Sat, 22 Apr 2023 15:51:03 +0200 Subject: [PATCH] a --- src/ExpiredCollector.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ExpiredCollector.php b/src/ExpiredCollector.php index 0eb6795..17d1bb4 100644 --- a/src/ExpiredCollector.php +++ b/src/ExpiredCollector.php @@ -79,14 +79,19 @@ class ExpiredCollector { * @param \Drupal\Core\Session\AccountInterface $account * The account. * + * @param boolean $includeRefresh + * Whether to include refresh tokens. + * * @return \Drupal\simple_oauth\Entity\Oauth2TokenInterface[] * The tokens. */ - public function collectForAccount(AccountInterface $account) { + public function collectForAccount(AccountInterface $account, $includeRefresh = FALSE) { $query = $this->tokenStorage->getQuery(); $query->accessCheck(); $query->condition('auth_user_id', $account->id()); - $query->condition('bundle', 'refresh_token', '!='); + if (!$includeRefresh) { + $query->condition('bundle', 'refresh_token', '!='); + } $entity_ids = $query->execute(); $output = $entity_ids ? array_values($this->tokenStorage->loadMultiple(array_values($entity_ids))) -- 2.34.1.windows.1