feat: enable specifying custom open authoring commit message (#2810)
This commit is contained in:
committed by
Shawn Erquhart
parent
f206e7e5a1
commit
2841ff9ffe
@ -45,7 +45,7 @@ export default class API {
|
||||
p => p.catch(err => Promise.reject(new APIError(err.message, null, 'BitBucket'))),
|
||||
])(req);
|
||||
|
||||
user = () => this.request('/user');
|
||||
user = () => this.requestJSON('/user');
|
||||
|
||||
hasWriteAccess = async () => {
|
||||
const response = await this.request(this.repoURL);
|
||||
|
@ -72,8 +72,7 @@ export default class BitbucketBackend {
|
||||
api_root: this.api_root,
|
||||
});
|
||||
|
||||
const user = await this.api.user();
|
||||
const isCollab = await this.api.hasWriteAccess(user).catch(error => {
|
||||
const isCollab = await this.api.hasWriteAccess().catch(error => {
|
||||
error.message = stripIndent`
|
||||
Repo "${this.repo}" not found.
|
||||
|
||||
@ -89,8 +88,16 @@ export default class BitbucketBackend {
|
||||
throw new Error('Your BitBucket user account does not have access to this repo.');
|
||||
}
|
||||
|
||||
const user = await this.api.user();
|
||||
|
||||
// Authorized user
|
||||
return { ...user, token: state.token, refresh_token: state.refresh_token };
|
||||
return {
|
||||
...user,
|
||||
name: user.display_name,
|
||||
login: user.username,
|
||||
token: state.token,
|
||||
refresh_token: state.refresh_token,
|
||||
};
|
||||
}
|
||||
|
||||
getRefreshedAccessToken() {
|
||||
|
Reference in New Issue
Block a user