Skip to content

Commit

Permalink
fix securityhandler check
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Oct 14, 2019
1 parent 756ea67 commit c203af7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/middlewares/openapi.security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ class SecuritySchemes {
try {
const securityKey = Object.keys(s)[0];
const scheme: any = this.securitySchemes[securityKey];
const handler = this.securityHandlers[securityKey] || fallbackHandler;
const handler =
(this.securityHandlers && this.securityHandlers[securityKey]) ||
fallbackHandler;
const scopesTmp = s[securityKey];
const scopes = Array.isArray(scopesTmp) ? scopesTmp : [];

Expand Down

0 comments on commit c203af7

Please sign in to comment.