propro-utils 1.4.88 → 1.4.90

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.4.88",
3
+ "version": "1.4.90",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -335,13 +335,9 @@ class AuthMiddleware {
335
335
  const formattedAuthUrl = formatRedirectUrl(this.options.authUrl);
336
336
  return axios({
337
337
  method: req.method,
338
- url: `${formattedAuthUrl}${path}`,
338
+ url: `${formattedAuthUrl}${path}&clientId=${this.options.clientId}&redirectUri=${this.options.redirectUri}`,
339
339
  data: req.body,
340
340
  headers: headers,
341
- query: {
342
- clientId: this.options.clientId,
343
- redirectUri: this.options.redirectUri,
344
- },
345
341
  });
346
342
  };
347
343
 
@@ -151,7 +151,10 @@ function formatRedirectUrl(redirectUrl) {
151
151
  !redirectUrl.startsWith('http://') &&
152
152
  !redirectUrl.startsWith('https://')
153
153
  ) {
154
- if (redirectUrl.includes('localhost')) {
154
+ if (
155
+ redirectUrl.includes('localhost') |
156
+ redirectUrl.includes('host.docker.internal')
157
+ ) {
155
158
  urlToRedirect = `http://${redirectUrl}`;
156
159
  } else {
157
160
  urlToRedirect = `https://${redirectUrl}`;