diff --git a/zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/CustomRedisTokenStore.java b/zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/CustomRedisTokenStore.java index 43193a3767ea84ac209d061556f73ab5e6c8bad9..ec1eba196fef4f632a4dc6ee3195126de2240b24 100644 --- a/zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/CustomRedisTokenStore.java +++ b/zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/CustomRedisTokenStore.java @@ -360,16 +360,14 @@ public class CustomRedisTokenStore implements TokenStore { byte[] accessToRefreshKey = serializeKey(ACCESS_TO_REFRESH + tokenValue); RedisConnection conn = getConnection(); try { + byte[] access = conn.get(accessKey); + byte[] auth = conn.get(authKey); conn.openPipeline(); - conn.get(accessKey); - conn.get(authKey); conn.del(accessKey); conn.del(accessToRefreshKey); // Don't remove the refresh token - it's up to the caller to do that conn.del(authKey); - List results = conn.closePipeline(); - byte[] access = (byte[]) results.get(0); - byte[] auth = (byte[]) results.get(1); + conn.closePipeline(); OAuth2Authentication authentication = deserializeAuthentication(auth); if (authentication != null) { @@ -471,20 +469,17 @@ public class CustomRedisTokenStore implements TokenStore { private void removeAccessTokenUsingRefreshToken(String refreshToken) { byte[] key = serializeKey(REFRESH_TO_ACCESS + refreshToken); - List results = null; RedisConnection conn = getConnection(); + byte[] bytes = null; try { - conn.openPipeline(); - conn.get(key); + bytes = conn.get(key); conn.del(key); - results = conn.closePipeline(); } finally { conn.close(); } - if (results == null) { + if (bytes == null) { return; } - byte[] bytes = (byte[]) results.get(0); String accessToken = deserializeString(bytes); if (accessToken != null) { removeAccessToken(accessToken);