Skip to content

Commit bdc7694

Browse files
Fix Variable names
1 parent 741329f commit bdc7694

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/java/main/controllers/Project/APITokenController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
import java.util.Objects;
1414

1515
public class APITokenController extends BaseController<APITokenDto> {
16-
private APITokenDao importTokenDao;
16+
private APITokenDao apiTokenDao;
1717
public APITokenController(UserDto user) {
1818
super(user);
19-
importTokenDao = new APITokenDao();
19+
apiTokenDao = new APITokenDao();
2020
}
2121

2222
@Override
@@ -27,7 +27,7 @@ public List<APITokenDto> get(APITokenDto entity) throws AqualityException {
2727
@Override
2828
public APITokenDto create(APITokenDto template) throws AqualityException {
2929
if(baseUser.isAdmin() || baseUser.isManager() || baseUser.getProjectUser(template.getId()).isManager() || baseUser.getProjectUser(template.getId()).isAdmin()){
30-
return importTokenDao.create(template);
30+
return apiTokenDao.create(template);
3131
}else{
3232
throw new AqualityPermissionsException("Account is not allowed to create API Token", baseUser);
3333
}
@@ -42,10 +42,10 @@ public boolean isTokenValid(String token, Integer projectId) throws AqualityExce
4242
String actualHash = DigestUtils.md5Hex(token + "advbc1671-nlksdui-ff");
4343
APITokenDto tokenDTO = new APITokenDto();
4444
tokenDTO.setId(projectId);
45-
List<APITokenDto> importTokens = importTokenDao.searchAll(tokenDTO);
45+
List<APITokenDto> apiTokens = apiTokenDao.searchAll(tokenDTO);
4646

47-
if(importTokens.size() > 0){
48-
String expectedHash = (importTokens.get(0)).getApi_token();
47+
if(apiTokens.size() > 0){
48+
String expectedHash = (apiTokens.get(0)).getApi_token();
4949
return Objects.equals(actualHash, expectedHash);
5050
}
5151

src/main/java/main/model/db/dao/project/UserDao.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private UserDto IsAuthorizedToken(String sessionId) throws AqualityException {
9393
return user;
9494
}
9595
else{
96-
throw new AqualityPermissionsException("The import token is not valid", null);
96+
throw new AqualityPermissionsException("The API token is not valid", null);
9797
}
9898
}
9999
}

0 commit comments

Comments
 (0)