Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e7bc980 authored by theronakpatel's avatar theronakpatel
Browse files

declaration reverted at function

parent 97ac0a71
Loading
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ use OCA\EcloudAccounts\Db\TwoFactorMapper;
use OCA\EcloudAccounts\Exception\SSOAdminAccessTokenException;
use OCA\EcloudAccounts\Exception\SSOAdminAPIException;
use OCP\ICache;
use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\ILogger;
use OCP\IUserManager;
@@ -28,8 +29,7 @@ class SSOService {
	private IFactory $l10nFactory;
	private IUserManager $userManager;
	private TwoFactorMapper $twoFactorMapper;

	private ICache $clientsCache;
	private ICacheFactory $cacheFactory;

	private string $mainDomain;
	private string $legacyDomain;
@@ -60,8 +60,7 @@ class SSOService {
		$this->l10nFactory = $l10nFactory;
		$this->userManager = $userManager;
		$this->twoFactorMapper = $twoFactorMapper;

		$this->clientsCache = $cacheFactory->createDistributed('ecloud_accounts_realm_clients');
		$this->cacheFactory = $cacheFactory;

		$this->mainDomain = $this->config->getSystemValue("main_domain");
		$this->legacyDomain = $this->config->getSystemValue("legacy_domain");
@@ -157,7 +156,8 @@ class SSOService {
		$cacheKey = "{$clientsUrl}|no_params|no_keys";
		
		// Try to get cached clients
		$cachedClients = $this->clientsCache->get($cacheKey);
		$clientsCache = $this->cacheFactory->createDistributed('ecloud_accounts_realm_clients');
		$cachedClients = $clientsCache->get($cacheKey);
		if ($cachedClients !== null) {
			$this->logger->debug('Returning cached clients from distributed cache');
			return $cachedClients;
@@ -171,7 +171,7 @@ class SSOService {
				return [];
			}

			$this->clientsCache->set($cacheKey, $clients, self::CLIENTS_CACHE_TTL);
			$clientsCache->set($cacheKey, $clients, self::CLIENTS_CACHE_TTL);
			
			return $clients;
		} catch (\Exception $e) {