Added scene chapters to GraphQL. Verifying API credential types.

This commit is contained in:
2026-09-17 01:17:03 +02:00
parent e9b7bb03d0
commit de0b1c2baf
4 changed files with 21 additions and 2 deletions
+8
View File
@@ -628,6 +628,14 @@ export async function verifyKey(userId, key, req) {
throw new HttpError('The API credentials are not provided.', 401);
}
if (typeof userId !== 'number') {
throw new HttpError('User ID is not a number', 400);
}
if (typeof key !== 'string') {
throw new HttpError('Key is not a string', 400);
}
const hashedKey = (await scrypt(key, '', 64)).toString('hex'); // salt redundant for randomly generated key
const storedKey = await knex('users_keys')