@sebspark/openapi-client 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -95,7 +95,7 @@ var paramsSerializer = (format) => (params) => {
95
95
  var TypedClient = (baseURL, globalOptions, logger) => {
96
96
  if (globalOptions?.authorizationTokenGenerator) {
97
97
  import_axios.default.interceptors.request.use(async (request) => {
98
- if (globalOptions?.authorizationTokenGenerator) {
98
+ if (globalOptions?.authorizationTokenGenerator && request.url) {
99
99
  const authorizationTokenHeaders = await globalOptions.authorizationTokenGenerator(request.url);
100
100
  if (authorizationTokenHeaders) {
101
101
  for (const [key, value] of Object.entries(
@@ -116,7 +116,7 @@ var TypedClient = (baseURL, globalOptions, logger) => {
116
116
  const axiosError = failedRequest;
117
117
  const url = `${axiosError.config?.baseURL}${axiosError.config?.url}`;
118
118
  if (globalOptions?.authorizationTokenRefresh && url) {
119
- await globalOptions?.authorizationTokenRefresh(axiosError.request.url);
119
+ await globalOptions?.authorizationTokenRefresh(url);
120
120
  }
121
121
  };
122
122
  (0, import_axios_auth_refresh.default)(import_axios.default, refreshAuthLogic);
package/dist/index.mjs CHANGED
@@ -60,7 +60,7 @@ var paramsSerializer = (format) => (params) => {
60
60
  var TypedClient = (baseURL, globalOptions, logger) => {
61
61
  if (globalOptions?.authorizationTokenGenerator) {
62
62
  axios.interceptors.request.use(async (request) => {
63
- if (globalOptions?.authorizationTokenGenerator) {
63
+ if (globalOptions?.authorizationTokenGenerator && request.url) {
64
64
  const authorizationTokenHeaders = await globalOptions.authorizationTokenGenerator(request.url);
65
65
  if (authorizationTokenHeaders) {
66
66
  for (const [key, value] of Object.entries(
@@ -81,7 +81,7 @@ var TypedClient = (baseURL, globalOptions, logger) => {
81
81
  const axiosError = failedRequest;
82
82
  const url = `${axiosError.config?.baseURL}${axiosError.config?.url}`;
83
83
  if (globalOptions?.authorizationTokenRefresh && url) {
84
- await globalOptions?.authorizationTokenRefresh(axiosError.request.url);
84
+ await globalOptions?.authorizationTokenRefresh(url);
85
85
  }
86
86
  };
87
87
  createAuthRefreshInterceptor(axios, refreshAuthLogic);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sebspark/openapi-client",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",