mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
prevent concurrent token read / refresh (#4686)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
+2
-2
@@ -291,7 +291,7 @@ public class OAuthClientServiceImpl implements OAuthClientService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessTokenResponse refreshToken() throws OAuthException, IOException, OAuthResponseException {
|
||||
public synchronized AccessTokenResponse refreshToken() throws OAuthException, IOException, OAuthResponseException {
|
||||
if (isClosed()) {
|
||||
throw new OAuthException(EXCEPTION_MESSAGE_CLOSED);
|
||||
}
|
||||
@@ -333,7 +333,7 @@ public class OAuthClientServiceImpl implements OAuthClientService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable AccessTokenResponse getAccessTokenResponse()
|
||||
public synchronized @Nullable AccessTokenResponse getAccessTokenResponse()
|
||||
throws OAuthException, IOException, OAuthResponseException {
|
||||
if (isClosed()) {
|
||||
throw new OAuthException(EXCEPTION_MESSAGE_CLOSED);
|
||||
|
||||
Reference in New Issue
Block a user