fix: find by key, not ID

This commit is contained in:
Eli Bosley
2024-12-19 12:33:56 -05:00
parent 143515560c
commit 124fb610b1
2 changed files with 2 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
{
"createdAt": "2024-12-19T16:49:56.848Z",
"createdAt": "2024-12-19T17:32:59.531Z",
"description": "API key for Connect user",
"id": "d166bf8b-3615-444a-8932-c460b2132ba3",
"key": "3a4e2332891e879d2ac8c3f25ef03a7b54f70b62cd6c5a08a86189cdd19ba203",

View File

@@ -13,7 +13,7 @@ export const createLocalApiKeyForConnectIfNecessary = async () => {
const { remote } = getters.config();
const service = new ApiKeyService();
// If the remote API Key is set and the local key is either not set or not found on disk, create a key
if (remote.apikey && (!remote.localApiKey || !(await service.findById(remote.localApiKey)))) {
if (remote.apikey && (!remote.localApiKey || !(await service.findByKey(remote.localApiKey)))) {
minigraphLogger.debug('Creating local API key for Connect');
// Create local API key
const apiKeyService = new ApiKeyService();