Updates
This commit is contained in:
+1
-2
@@ -19,7 +19,6 @@ const grabApiCred = ({ key, database, table, user_id, media, }) => {
|
||||
if (!allowedKeysPath)
|
||||
throw new Error("process.env.DSQL_API_KEYS_PATH variable not found");
|
||||
const ApiJSON = (0, decrypt_1.default)({ encryptedString: key });
|
||||
/** @type {import("../../types").ApiKeyObject} */
|
||||
const ApiObject = JSON.parse(ApiJSON || "");
|
||||
const isApiKeyValid = fs_1.default.existsSync(`${allowedKeysPath}/${ApiObject.sign}`);
|
||||
if (String(ApiObject.user_id) !== String(user_id))
|
||||
@@ -42,7 +41,7 @@ const grabApiCred = ({ key, database, table, user_id, media, }) => {
|
||||
return ApiObject;
|
||||
return null;
|
||||
}
|
||||
catch ( /** @type {any} */error) {
|
||||
catch (error) {
|
||||
console.log(`api-cred ERROR: ${error.message}`);
|
||||
return { error: `api-cred ERROR: ${error.message}` };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user