From 2cfb898fd0876641672fc9f08512f6049cf1fc60 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 3 May 2019 13:04:00 +0200 Subject: [PATCH] use basic handler --- src/util.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util.ts b/src/util.ts index 0944862..d9968ce 100644 --- a/src/util.ts +++ b/src/util.ts @@ -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'; @@ -23,7 +23,7 @@ export function getPublishedUrl(extension: string): string { export async function getGalleryAPI(pat: string): Promise { // 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); @@ -31,7 +31,7 @@ export async function getGalleryAPI(pat: string): Promise { } export async function getSecurityRolesAPI(pat: string): Promise { - const authHandler = getPersonalAccessTokenHandler(pat); + const authHandler = getBasicHandler('OAuth', pat); const vsoapi = new WebApi(marketplaceUrl, authHandler); return await vsoapi.getSecurityRolesApi(); }