From 7fa36ae6618d2795dcc3e9e69db124c0a1f59781 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Mon, 16 Sep 2024 11:30:56 +0100 Subject: [PATCH 1/2] Only get tokens if team feature enabled fixes #4382 --- frontend/src/pages/instance/Settings/Security.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/instance/Settings/Security.vue b/frontend/src/pages/instance/Settings/Security.vue index e6ad17fef1..26cfb2ab30 100644 --- a/frontend/src/pages/instance/Settings/Security.vue +++ b/frontend/src/pages/instance/Settings/Security.vue @@ -157,7 +157,7 @@ export default { mounted () { this.checkAccess() this.getSettings() - if (this.settings.features.httpBearerTokens) { + if (this.settings.features.httpBearerTokens && this.team.type.properties.features.teamHttpSecurity) { this.getTokens() } }, From 7bc44264b82b4392b44b5348aeb9707d38c3d841 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Mon, 16 Sep 2024 13:14:43 +0100 Subject: [PATCH 2/2] Move to feature mixin --- frontend/src/mixins/Features.js | 3 +++ frontend/src/pages/instance/Settings/Security.vue | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/mixins/Features.js b/frontend/src/mixins/Features.js index 0a6970375e..9b0048927a 100644 --- a/frontend/src/mixins/Features.js +++ b/frontend/src/mixins/Features.js @@ -41,6 +41,9 @@ export default { }, isStaticAssetFeatureEnabled () { return this.isStaticAssetFeatureEnabledForPlatform && this.isStaticAssetsFeatureEnabledForTeam + }, + isHTTPBearerTokensFeatureEnabledForTeam () { + return this.settings.features.httpBearerTokens && this.team.type.properties.features.teamHttpSecurity } } } diff --git a/frontend/src/pages/instance/Settings/Security.vue b/frontend/src/pages/instance/Settings/Security.vue index 26cfb2ab30..016e2765c8 100644 --- a/frontend/src/pages/instance/Settings/Security.vue +++ b/frontend/src/pages/instance/Settings/Security.vue @@ -50,6 +50,7 @@ import { mapState } from 'vuex' import InstanceApi from '../../../api/instances.js' import FormHeading from '../../../components/FormHeading.vue' +import featuresMixin from '../../../mixins/Features.js' import permissionsMixin from '../../../mixins/Permissions.js' import alerts from '../../../services/alerts.js' import TokenCreated from '../../account/Security/dialogs/TokenCreated.vue' @@ -76,7 +77,7 @@ export default { TokenCreated, TokenDialog }, - mixins: [permissionsMixin], + mixins: [permissionsMixin, featuresMixin], inheritAttrs: false, props: { project: { @@ -157,7 +158,7 @@ export default { mounted () { this.checkAccess() this.getSettings() - if (this.settings.features.httpBearerTokens && this.team.type.properties.features.teamHttpSecurity) { + if (this.isHTTPBearerTokensFeatureEnabledForTeam()) { this.getTokens() } },