This commit is contained in:
Benjamin Toby
2025-04-23 13:45:48 +01:00
parent cd6bfdfc67
commit d78e44c98d
12 changed files with 42 additions and 21 deletions
+3 -2
View File
@@ -24,10 +24,11 @@ const grabApiCred: CheckApiCredentialsFn = ({
);
const ApiJSON = decrypt({ encryptedString: key });
/** @type {import("../../types").ApiKeyObject} */
const ApiObject: import("../../types").ApiKeyObject = JSON.parse(
ApiJSON || ""
);
const isApiKeyValid = fs.existsSync(
`${allowedKeysPath}/${ApiObject.sign}`
);
@@ -50,7 +51,7 @@ const grabApiCred: CheckApiCredentialsFn = ({
.includes(String(table));
if (isTableAllowed) return ApiObject;
return null;
} catch (/** @type {any} */ error: any) {
} catch (error: any) {
console.log(`api-cred ERROR: ${error.message}`);
return { error: `api-cred ERROR: ${error.message}` };
}