Skip to content

Commit

Permalink
adjusts in create instance
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidsonGomes committed May 23, 2024
1 parent f7dcab3 commit 68dcc1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/api/controllers/instance.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 5 additions & 3 deletions src/api/guards/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 68dcc1c

Please sign in to comment.