Skip to content

Commit

Permalink
chore: convert parameters to object in authorize
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVarchuk committed Sep 15, 2021
1 parent 9ae96b3 commit 31ae7f6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/redocly/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class RedoclyClient {

async verifyToken(accessToken: string, verbose: boolean = false): Promise<boolean> {
if (!accessToken) return false;
const authDetails = await RedoclyClient.authorize(accessToken, verbose);
const authDetails = await RedoclyClient.authorize(accessToken, { verbose });
if (!authDetails) return false;
return true;
}
Expand Down Expand Up @@ -91,7 +91,8 @@ export class RedoclyClient {
});
}

static async authorize(accessToken: string, verbose: boolean = false, queryName = '') {
static async authorize(accessToken: string, options: { queryName?: string; verbose?: boolean }) {
const { queryName = '', verbose = false } = options;
try {
const queryStr = `query ${queryName}{ viewer { id } }`;

Expand Down

0 comments on commit 31ae7f6

Please sign in to comment.