fix: handle error if security scopes is invalid (#2113)

This commit is contained in:
Alex Varchuk 2022-08-02 13:52:15 +03:00 committed by GitHub
parent cf4642e303
commit 428fd6983d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@ function getRequiredScopes(id: string, securities: SecurityRequirementModel[]):
let schemesLength = security.schemes.length;
while (schemesLength--) {
const scheme = security.schemes[schemesLength];
if (scheme.id === id) {
if (scheme.id === id && Array.isArray(scheme.scopes)) {
allScopes.push(...scheme.scopes);
}
}