prevent concurrent token read / refresh (#4686)

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
pull/4688/head
Andrew Fiddian-Green 2025-03-29 17:09:33 +00:00 committed by GitHub
parent 0f354e63f3
commit 1960646a6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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);