diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-04-27 13:51:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-27 13:51:44 +0200 |
commit | 21da3594f63634d312300dacfa17d62632a2d2a9 (patch) | |
tree | bf810f2ed073688166ff7ea8749774dee50c1610 /lib | |
parent | 7da1e968f96845c601b0e3ea52be083336bda814 (diff) | |
parent | a0e038f91261a3ea75ca2c4c06a269c44bb9a575 (diff) | |
download | nextcloud-server-21da3594f63634d312300dacfa17d62632a2d2a9.tar.gz nextcloud-server-21da3594f63634d312300dacfa17d62632a2d2a9.zip |
Merge pull request #9322 from nextcloud/bugfix/noid/swift_token_cache
Better swift V3 token handling
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/ObjectStore/SwiftFactory.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php index 8baaec985e8..3ff534b4e64 100644 --- a/lib/private/Files/ObjectStore/SwiftFactory.php +++ b/lib/private/Files/ObjectStore/SwiftFactory.php @@ -56,7 +56,7 @@ class SwiftFactory { private function getCachedToken(string $cacheKey) { $cachedTokenString = $this->cache->get($cacheKey . '/token'); if ($cachedTokenString) { - return json_decode($cachedTokenString); + return json_decode($cachedTokenString, true); } else { return null; } @@ -131,9 +131,9 @@ class SwiftFactory { $cachedToken = $this->params['cachedToken']; $hasValidCachedToken = false; - if (is_array($cachedToken)) { + if (\is_array($cachedToken) && ($authService instanceof IdentityV3Service)) { $token = $authService->generateTokenFromCache($cachedToken); - if (is_null($token->catalog)) { + if (\is_null($token->catalog)) { $this->logger->warning('Invalid cached token for swift, no catalog set: ' . json_encode($cachedToken)); } else if ($token->hasExpired()) { $this->logger->debug('Cached token for swift expired'); |