mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-11-04 09:47:31 +03:00 
			
		
		
		
	fix: handle error if security scopes is invalid (#2113)
This commit is contained in:
		
							parent
							
								
									cf4642e303
								
							
						
					
					
						commit
						428fd6983d
					
				| 
						 | 
					@ -92,7 +92,7 @@ function getRequiredScopes(id: string, securities: SecurityRequirementModel[]):
 | 
				
			||||||
    let schemesLength = security.schemes.length;
 | 
					    let schemesLength = security.schemes.length;
 | 
				
			||||||
    while (schemesLength--) {
 | 
					    while (schemesLength--) {
 | 
				
			||||||
      const scheme = security.schemes[schemesLength];
 | 
					      const scheme = security.schemes[schemesLength];
 | 
				
			||||||
      if (scheme.id === id) {
 | 
					      if (scheme.id === id && Array.isArray(scheme.scopes)) {
 | 
				
			||||||
        allScopes.push(...scheme.scopes);
 | 
					        allScopes.push(...scheme.scopes);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user