Skip to content

Commit

Permalink
use basic handler
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed May 3, 2019
1 parent 3502fba commit 2cfb898
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as _read from 'read';
import { WebApi, getPersonalAccessTokenHandler } from 'azure-devops-node-api/WebApi';
import { WebApi, getBasicHandler } from 'azure-devops-node-api/WebApi';
import { IGalleryApi, GalleryApi } from 'azure-devops-node-api/GalleryApi';
import * as denodeify from 'denodeify';
import chalk from 'chalk';
Expand All @@ -23,15 +23,15 @@ export function getPublishedUrl(extension: string): string {

export async function getGalleryAPI(pat: string): Promise<IGalleryApi> {
// from https://github.com/Microsoft/tfs-cli/blob/master/app/exec/extension/default.ts#L287-L292
const authHandler = getPersonalAccessTokenHandler(pat);
const authHandler = getBasicHandler('OAuth', pat);
return new GalleryApi(marketplaceUrl, [authHandler]);

// const vsoapi = new WebApi(marketplaceUrl, authHandler);
// return await vsoapi.getGalleryApi();
}

export async function getSecurityRolesAPI(pat: string): Promise<ISecurityRolesApi> {
const authHandler = getPersonalAccessTokenHandler(pat);
const authHandler = getBasicHandler('OAuth', pat);
const vsoapi = new WebApi(marketplaceUrl, authHandler);
return await vsoapi.getSecurityRolesApi();
}
Expand Down

0 comments on commit 2cfb898

Please sign in to comment.