Skip to content

Commit

Permalink
fix: make isAuthorizedWithRedocly recognize valid Redocly tokens (#1807)
Browse files Browse the repository at this point in the history
* fix: make isAuthorizedWithRedocly recognize valid Redocly tokens

* Update .changeset/nervous-bikes-wait.md

---------

Co-authored-by: Jacek Łękawa <[email protected]>
  • Loading branch information
tatomyr and JLekawa authored Nov 20, 2024
1 parent e711a94 commit 884ca34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/nervous-bikes-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@redocly/openapi-core": patch
"@redocly/cli": patch
---

Fixed an issue where valid Redocly tokens were not recognized.
4 changes: 2 additions & 2 deletions packages/core/src/redocly/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -135,7 +135,7 @@ export class RedoclyClient {
}

async isAuthorizedWithRedocly(): Promise<boolean> {
return this.hasTokens() && isNotEmptyObject(await this.getValidTokens());
return this.hasTokens() && isNotEmptyArray(await this.getValidTokens());
}

readCredentialsFile(credentialsPath: string) {
Expand Down

1 comment on commit 884ca34

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.83% 5016/6363
🟡 Branches 67.53% 2076/3074
🟡 Functions 73.32% 830/1132
🟡 Lines 79.14% 4734/5982

Test suite run success

812 tests passing in 121 suites.

Report generated by 🧪jest coverage report action from 884ca34

Please sign in to comment.