Skip to content

Commit 2cfb898

Browse files
committed
use basic handler
1 parent 3502fba commit 2cfb898

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _read from 'read';
2-
import { WebApi, getPersonalAccessTokenHandler } from 'azure-devops-node-api/WebApi';
2+
import { WebApi, getBasicHandler } from 'azure-devops-node-api/WebApi';
33
import { IGalleryApi, GalleryApi } from 'azure-devops-node-api/GalleryApi';
44
import * as denodeify from 'denodeify';
55
import chalk from 'chalk';
@@ -23,15 +23,15 @@ export function getPublishedUrl(extension: string): string {
2323

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

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

3333
export async function getSecurityRolesAPI(pat: string): Promise<ISecurityRolesApi> {
34-
const authHandler = getPersonalAccessTokenHandler(pat);
34+
const authHandler = getBasicHandler('OAuth', pat);
3535
const vsoapi = new WebApi(marketplaceUrl, authHandler);
3636
return await vsoapi.getSecurityRolesApi();
3737
}

0 commit comments

Comments
 (0)