Skip to content

Commit 6df65bf

Browse files
committed
update
1 parent a21b351 commit 6df65bf

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

components/azure_devops/azure_devops.app.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { axios } from "@pipedream/platform";
1+
import {
2+
axios, ConfigurationError,
3+
} from "@pipedream/platform";
24
const API_VERSION = "5.0";
35

46
export default {
@@ -29,9 +31,13 @@ export default {
2931
return "https://dev.azure.com";
3032
},
3133
_headers(useOAuth) {
32-
const basicAuth = Buffer.from(`${this._oauthUid()}:${useOAuth
34+
const token = useOAuth
3335
? this._oauthAccessToken()
34-
: this._personalAccessToken()}`).toString("base64");
36+
: this._personalAccessToken();
37+
if (!token && !useOAuth) {
38+
throw new ConfigurationError("Azure DevOps Personal Access Token is required for this operation. Add it to your Azure DevOps connection.");
39+
}
40+
const basicAuth = Buffer.from(`${this._oauthUid()}:${token}`).toString("base64");
3541
return {
3642
Authorization: `Basic ${basicAuth}`,
3743
};

0 commit comments

Comments
 (0)