Skip to content

Commit

Permalink
fix: autoRefreshToken in traditional api call
Browse files Browse the repository at this point in the history
  • Loading branch information
dantio committed Apr 25, 2021
1 parent aea44a2 commit faadf94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/traditional/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,14 @@ export default class Traditional extends Api {
}

private async request(options: Options, api: TraditionalApi, callName: string, fields: Fields, refreshToken = false) {
const config = this.getConfig(api, callName, options);
const xmlRequest = new XMLRequest(callName, fields, config, this.req);
try {
if (refreshToken) {
await this.auth.OAuth2.refreshAuthToken();
}

const config = this.getConfig(api, callName, options);
const xmlRequest = new XMLRequest(callName, fields, config, this.req);

return await xmlRequest.request();
} catch (e) {
handleEBayError(e)
Expand Down

0 comments on commit faadf94

Please sign in to comment.