diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-12 20:53:38 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-12 20:53:50 +0100 |
commit | 4e8d5504d2acf27a25e1d2068dea06faa3604a39 (patch) | |
tree | 03c1e9394dbefc8e77401e57e01ff5d988734110 /lib | |
parent | fac0a11576874e25141e34749e7bc64a688b2506 (diff) | |
download | nextcloud-server-4e8d5504d2acf27a25e1d2068dea06faa3604a39.tar.gz nextcloud-server-4e8d5504d2acf27a25e1d2068dea06faa3604a39.zip |
Properly cache swift v3 token
The V3 token has an export function. Without this the token is
effectively never cached.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/ObjectStore/SwiftFactory.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php index 9513cdc3ab8..eab3441ff2c 100644 --- a/lib/private/Files/ObjectStore/SwiftFactory.php +++ b/lib/private/Files/ObjectStore/SwiftFactory.php @@ -60,7 +60,12 @@ class SwiftFactory { } private function cacheToken(Token $token, string $cacheKey) { - $this->cache->set($cacheKey . '/token', json_encode($token)); + if ($token instanceof \OpenStack\Identity\v3\Models\Token) { + $value = json_encode($token->export()); + } else { + $value = json_encode($token); + } + $this->cache->set($cacheKey . '/token', $value); } /** |