adjusts in create instance

This commit is contained in:
Davidson Gomes 2024-05-23 11:56:52 -03:00
parent f7dcab3736
commit 68dcc1c86a
2 changed files with 5 additions and 4 deletions

View File

@ -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;

View File

@ -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) {