From 71bac0de81d02bc92cf600ab9269d9481f4351f4 Mon Sep 17 00:00:00 2001 From: Maxim Gorbunkov Date: Tue, 14 Jul 2020 15:36:49 +0400 Subject: [PATCH] ServerTokenStoreImpl does not publish refresh token events to cluster #102 --- .../addon/restapi/store/ServerTokenStoreImpl.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/core/src/com/haulmont/addon/restapi/store/ServerTokenStoreImpl.java b/modules/core/src/com/haulmont/addon/restapi/store/ServerTokenStoreImpl.java index 4d90486..2f6eb8e 100644 --- a/modules/core/src/com/haulmont/addon/restapi/store/ServerTokenStoreImpl.java +++ b/modules/core/src/com/haulmont/addon/restapi/store/ServerTokenStoreImpl.java @@ -389,6 +389,13 @@ public void storeRefreshToken(String refreshTokenValue, tx.commit(); } } + + if (restConfig.getSyncTokenReplication()) { + clusterManagerAPI.sendSync(new TokenStoreAddRefreshTokenMsg(refreshTokenValue, refreshTokenBytes, authenticationBytes, tokenExpiry, userLogin, null)); + } else { + clusterManagerAPI.send(new TokenStoreAddRefreshTokenMsg(refreshTokenValue, refreshTokenBytes, authenticationBytes, tokenExpiry, userLogin, null)); + } + } protected void storeRefreshTokenToMemory(String refreshTokenValue, @@ -644,6 +651,12 @@ public void removeRefreshToken(String refreshTokenValue) { if (restConfig.getRestStoreTokensInDb()) { removeRefreshTokenFromDatabase(refreshTokenValue); } + + if (restConfig.getSyncTokenReplication()) { + clusterManagerAPI.sendSync(new TokenStoreRemoveRefreshTokenMsg(refreshTokenValue)); + } else { + clusterManagerAPI.send(new TokenStoreRemoveRefreshTokenMsg(refreshTokenValue)); + } } protected void removeRefreshTokenFromMemory(String refreshTokenValue) {