Merge pull request #8794 from nextcloud/swift-v3-cache-token

Properly cache swift v3 token
This commit is contained in:
Morris Jobke 2018-03-13 11:35:38 +01:00 committed by GitHub
commit 45895de531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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);
}
/**