diff --git a/.changeset/nervous-bikes-wait.md b/.changeset/nervous-bikes-wait.md new file mode 100644 index 0000000000..e39002e2ec --- /dev/null +++ b/.changeset/nervous-bikes-wait.md @@ -0,0 +1,6 @@ +--- +"@redocly/openapi-core": patch +"@redocly/cli": patch +--- + +Fixed an issue where valid Redocly tokens were not recognized. diff --git a/packages/core/src/redocly/index.ts b/packages/core/src/redocly/index.ts index b02730f6c8..bf8b39887b 100644 --- a/packages/core/src/redocly/index.ts +++ b/packages/core/src/redocly/index.ts @@ -3,7 +3,7 @@ import { resolve } from 'path'; import { homedir } from 'os'; import { RegistryApi } from './registry-api'; import { env } from '../env'; -import { isNotEmptyObject } from '../utils'; +import { isNotEmptyArray, isNotEmptyObject } from '../utils'; import { colorize } from '../logger'; import { AVAILABLE_REGIONS, @@ -135,7 +135,7 @@ export class RedoclyClient { } async isAuthorizedWithRedocly(): Promise { - return this.hasTokens() && isNotEmptyObject(await this.getValidTokens()); + return this.hasTokens() && isNotEmptyArray(await this.getValidTokens()); } readCredentialsFile(credentialsPath: string) {