diff --git a/src/api/controllers/instance.controller.ts b/src/api/controllers/instance.controller.ts index 0d743f375..0ead0be1b 100644 --- a/src/api/controllers/instance.controller.ts +++ b/src/api/controllers/instance.controller.ts @@ -687,7 +687,6 @@ export class InstanceController { if (env.KEY !== key) { const instanceByKey = await this.repository.auth.findByKey(key); - console.log('instanceByKey', instanceByKey); if (instanceByKey) { name = instanceByKey._id; arrayReturn = true; diff --git a/src/api/guards/auth.guard.ts b/src/api/guards/auth.guard.ts index b7c7c7c0d..8168e80fa 100644 --- a/src/api/guards/auth.guard.ts +++ b/src/api/guards/auth.guard.ts @@ -79,9 +79,11 @@ async function apikey(req: Request, _: Response, next: NextFunction) { return next(); } } else { - const instanceByKey = await repository.auth.findByKey(key); - if (instanceByKey) { - return next(); + if (req.originalUrl.includes('/instance/fetchInstances')) { + const instanceByKey = await repository.auth.findByKey(key); + if (instanceByKey) { + return next(); + } } } } catch (error) {