-
-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
What am I doing wrong here?
Consider the following code:
import { Bitbucket } from "bitbucket";
const apiToken = 'Token as copied from https://id.atlassian.com/manage/api-tokens';
const bitbucket = new Bitbucket({
baseUrl: 'https://api.bitbucket.org/2.0',
auth: {
token: apiToken,
}
});
const repos = bitbucket.user.get({}).then(value => {
console.log(value.data);
});
Steps to reproduce
- Go to https://id.atlassian.com/manage/api-tokens
- Create a new API token.
- Copy the API token
- In the code above replace "Token as copied from https://id.atlassian.com/manage/api-tokens'" with the API token.
- Run the code.
Expected
The current user is being logged.
Actual
BITBUCKET CLOUD API LATEST UPDATES: https://developer.atlassian.com/cloud/bitbucket
index.ts:11
Process exited with code 1
Uncaught i HTTPError: Unauthorized
at <anonymous> (/wrk/bitbucket/node_modules/bitbucket/src/request/fetch-wrapper.ts:48:17)
at processTicksAndRejections (internal/process/task_queues:95:5)
Metadata
Metadata
Assignees
Labels
No labels