Skip to content

Commit

Permalink
Disable sharing account token by default
Browse files Browse the repository at this point in the history
  • Loading branch information
blootsvoets committed Aug 28, 2023
1 parent 03b7957 commit e06feb4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class ManagementPortalProperties {

private final CatalogueServer catalogueServer = new CatalogueServer();

private final Account account = new Account();

public ManagementPortalProperties.Frontend getFrontend() {
return frontend;
}
Expand All @@ -44,6 +46,22 @@ public Common getCommon() {
return common;
}

public Account getAccount() {
return account;
}

public static class Account {
private boolean enableExposeToken = false;

public boolean getEnableExposeToken() {
return enableExposeToken;
}

public void setEnableExposeToken(boolean enableExposeToken) {
this.enableExposeToken = enableExposeToken;
}
}

public static class Common {

private String baseUrl = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ public UserDTO getAccount() {
"Cannot get account without user", USER, ERR_ACCESS_DENIED));

UserDTO userDto = userMapper.userToUserDTO(currentUser);
userDto.setAccessToken(token.getToken());
if (managementPortalProperties.getAccount().getEnableExposeToken()) {
userDto.setAccessToken(token.getToken());
}
return userDto;
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ info:
#
# ===================================================================
managementportal:
account:
enableExposeToken: false
mail: # specific JHipster mail property, for standard properties see MailProperties
from: ManagementPortal@localhost
oauth:
Expand Down

0 comments on commit e06feb4

Please sign in to comment.