mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
fix(core): Stop enforcing max numbers of API keys limit (no-changelog) (#13631)
This commit is contained in:
@@ -63,7 +63,6 @@ export const defaultSettings: FrontendSettings = {
|
||||
enabled: false,
|
||||
},
|
||||
publicApi: {
|
||||
apiKeysPerUserLimit: 0,
|
||||
enabled: false,
|
||||
latestVersion: 0,
|
||||
path: '',
|
||||
|
||||
@@ -4,14 +4,12 @@ import { useRootStore } from '@/stores/root.store';
|
||||
|
||||
import * as publicApiApi from '@/api/api-keys';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useSettingsStore } from './settings.store';
|
||||
import type { ApiKey, CreateApiKeyRequestDto, UpdateApiKeyRequestDto } from '@n8n/api-types';
|
||||
|
||||
export const useApiKeysStore = defineStore(STORES.API_KEYS, () => {
|
||||
const apiKeys = ref<ApiKey[]>([]);
|
||||
|
||||
const rootStore = useRootStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
|
||||
const apiKeysSortByCreationDate = computed(() =>
|
||||
apiKeys.value.sort((a, b) => b.createdAt.localeCompare(a.createdAt)),
|
||||
@@ -27,10 +25,6 @@ export const useApiKeysStore = defineStore(STORES.API_KEYS, () => {
|
||||
);
|
||||
});
|
||||
|
||||
const canAddMoreApiKeys = computed(
|
||||
() => apiKeys.value.length < settingsStore.api.apiKeysPerUserLimit,
|
||||
);
|
||||
|
||||
const getAndCacheApiKeys = async () => {
|
||||
if (apiKeys.value.length) return apiKeys.value;
|
||||
apiKeys.value = await publicApiApi.getApiKeys(rootStore.restApiContext);
|
||||
@@ -62,6 +56,5 @@ export const useApiKeysStore = defineStore(STORES.API_KEYS, () => {
|
||||
apiKeysSortByCreationDate,
|
||||
apiKeysById,
|
||||
apiKeys,
|
||||
canAddMoreApiKeys,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -32,7 +32,6 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => {
|
||||
});
|
||||
const templatesEndpointHealthy = ref(false);
|
||||
const api = ref({
|
||||
apiKeysPerUserLimit: 0,
|
||||
enabled: false,
|
||||
latestVersion: 0,
|
||||
path: '/',
|
||||
|
||||
@@ -179,11 +179,7 @@ function onEdit(id: string) {
|
||||
</n8n-link>
|
||||
</div>
|
||||
<div class="mt-m text-right">
|
||||
<n8n-button
|
||||
size="large"
|
||||
:disabled="!apiKeysStore.canAddMoreApiKeys"
|
||||
@click="onCreateApiKey"
|
||||
>
|
||||
<n8n-button size="large" @click="onCreateApiKey">
|
||||
{{ i18n.baseText('settings.api.create.button') }}
|
||||
</n8n-button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user