(config: AxiosRequestConfig)
| 26 | } |
| 27 | |
| 28 | async requestWithAuthIfRequired(config: AxiosRequestConfig) { |
| 29 | const token = await this.getAccessToken(); |
| 30 | const authorizationHeaders = token ? { Authorization: `Bearer ${token}` } : {}; |
| 31 | |
| 32 | return axios({ |
| 33 | ...config, |
| 34 | headers: { |
| 35 | ...config.headers, |
| 36 | ...authorizationHeaders |
| 37 | } |
| 38 | }); |
| 39 | } |
| 40 | } |
no test coverage detected