aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-04-27 13:51:44 +0200
committerGitHub <noreply@github.com>2018-04-27 13:51:44 +0200
commit21da3594f63634d312300dacfa17d62632a2d2a9 (patch)
treebf810f2ed073688166ff7ea8749774dee50c1610 /lib
parent7da1e968f96845c601b0e3ea52be083336bda814 (diff)
parenta0e038f91261a3ea75ca2c4c06a269c44bb9a575 (diff)
downloadnextcloud-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.php6
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');