Skip to content

Commit

Permalink
Making token fetch thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
AsabuHere committed Jun 13, 2024
1 parent ba5c794 commit a91fb70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public interface TokenManager {
public String refreshAccessToken(String refreshToken);
public String fetchAccessToken();
public synchronized String fetchAccessToken();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public String refreshAccessToken(String refreshToken){
return token.getAccessToken();
}

public String fetchAccessToken(){
public synchronized String fetchAccessToken(){
Token token = Token.creator(grantType, clientId).setClientSecret(clientSecret).create();
return token.getAccessToken();
}
Expand Down

0 comments on commit a91fb70

Please sign in to comment.