From 05ac50a6e5ae852c98a2e782f439f17a59b9141a Mon Sep 17 00:00:00 2001 From: Igor O Date: Mon, 22 Apr 2024 15:55:29 -0700 Subject: [PATCH] Fixed auth servers in test console on switching apis --- .../operation-details/ko/runtime/operation-details.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/operations/operation-details/ko/runtime/operation-details.ts b/src/components/operations/operation-details/ko/runtime/operation-details.ts index eaf5e298f..031b79fc2 100644 --- a/src/components/operations/operation-details/ko/runtime/operation-details.ts +++ b/src/components/operations/operation-details/ko/runtime/operation-details.ts @@ -227,15 +227,13 @@ export class OperationDetails { let associatedAuthServers: AuthorizationServer[]; if (api.authenticationSettings?.oAuth2AuthenticationSettings?.length > 0) { associatedAuthServers = await this.oauthService.getOauthServers(api.id); - } + } else if (api.authenticationSettings?.openidAuthenticationSettings?.length > 0) { associatedAuthServers = await this.oauthService.getOpenIdAuthServers(api.id); } - if (associatedAuthServers) { - this.apiDocumentationAuthServers(associatedAuthServers.filter(a => a.useInApiDocumentation)); - this.testConsoleAuthServers(associatedAuthServers.filter(a => a.useInTestConsole)); - } + this.apiDocumentationAuthServers(associatedAuthServers ? associatedAuthServers.filter(a => a.useInApiDocumentation) : []); + this.testConsoleAuthServers(associatedAuthServers ? associatedAuthServers.filter(a => a.useInTestConsole) : []); } public async loadOperation(apiName: string, operationName: string): Promise {