diff --git a/iam-login-service/src/main/java/it/infn/mw/iam/api/client/service/ClientConverter.java b/iam-login-service/src/main/java/it/infn/mw/iam/api/client/service/ClientConverter.java index 9063a5d6a..74a6eb27b 100644 --- a/iam-login-service/src/main/java/it/infn/mw/iam/api/client/service/ClientConverter.java +++ b/iam-login-service/src/main/java/it/infn/mw/iam/api/client/service/ClientConverter.java @@ -68,14 +68,14 @@ public ClientDetailsEntity entityFromClientManagementRequest(RegisteredClientDTO if (dto.getAccessTokenValiditySeconds() != null) { if (dto.getAccessTokenValiditySeconds() <= 0) { - client.setAccessTokenValiditySeconds(null); + client.setAccessTokenValiditySeconds(0); } else { client.setAccessTokenValiditySeconds(dto.getAccessTokenValiditySeconds()); } } if (dto.getRefreshTokenValiditySeconds() != null) { if (dto.getRefreshTokenValiditySeconds() <= 0) { - client.setRefreshTokenValiditySeconds(null); + client.setRefreshTokenValiditySeconds(0); } else { client.setRefreshTokenValiditySeconds(dto.getRefreshTokenValiditySeconds()); } diff --git a/iam-login-service/src/main/webapp/resources/iam/apps/dashboard-app/components/clients/client/tokensettings/tokensettings.component.js b/iam-login-service/src/main/webapp/resources/iam/apps/dashboard-app/components/clients/client/tokensettings/tokensettings.component.js index 563f668c8..62a005fa3 100644 --- a/iam-login-service/src/main/webapp/resources/iam/apps/dashboard-app/components/clients/client/tokensettings/tokensettings.component.js +++ b/iam-login-service/src/main/webapp/resources/iam/apps/dashboard-app/components/clients/client/tokensettings/tokensettings.component.js @@ -28,15 +28,14 @@ self.hasDeviceCodeGrantType = false; self.accessTokenValiditySeconds = getAccessTokenValiditySeconds(); self.refreshTokenValiditySeconds = getRefreshTokenValiditySeconds(); - self.rtDoNotExpire = false; self.$onInit = function () { console.debug('TokenSettingsController.self', self); - if (!self.client.access_token_validity_seconds) { + if (self.client.access_token_validity_seconds == null) { self.client.access_token_validity_seconds = self.accessTokenValiditySeconds; } - if (!self.client.refresh_token_validity_seconds) { + if (self.client.refresh_token_validity_seconds == null) { self.client.refresh_token_validity_seconds = self.refreshTokenValiditySeconds; } @@ -47,14 +46,9 @@ }); $scope.$watch('$ctrl.client.refresh_token_validity_seconds', function handleChange(newVal, oldVal) { - if (newVal <= 0) { self.client.refresh_token_validity_seconds = 0; - self.rtDoNotExpire = true; - } else { - self.rtDoNotExpire = false; } - }); $scope.$watch('$ctrl.client.grant_types', function handleChange(newVal, oldVal) {