Skip to content

Commit

Permalink
DTSCCI-893 Moved variable from instance to method level to prevent po…
Browse files Browse the repository at this point in the history
…tential concurrency issue (#1496)

Co-authored-by: kdaHMCTS <128375235+kdaHMCTS@users.noreply.github.com>
  • Loading branch information
guygrewal77 and kdaHMCTS authored Oct 9, 2024
1 parent 15b5f4b commit b1b1498
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public class AuthorisationService {

private final IdamClient idamClient;

private UserInfo userInfo;

public Boolean authoriseService(String serviceAuthHeader) {
String callingService;
try {
Expand All @@ -45,7 +43,7 @@ public Boolean authoriseService(String serviceAuthHeader) {

public Boolean authoriseUser(String authorisation) {
try {
userInfo = idamClient.getUserInfo(authorisation);
UserInfo userInfo = idamClient.getUserInfo(authorisation);
if (null != userInfo) {
return true;
}
Expand All @@ -56,10 +54,6 @@ public Boolean authoriseUser(String authorisation) {
return false;
}

public UserInfo getUserInfo() {
return this.userInfo;
}

public boolean isServiceAndUserAuthorized(String authorisation, String s2sToken) {
return Boolean.TRUE.equals(authoriseUser(authorisation))
&& Boolean.TRUE.equals(authoriseService(s2sToken));
Expand Down

0 comments on commit b1b1498

Please sign in to comment.