propro-utils 1.4.16 → 1.4.17

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.16",
3
+ "version": "1.4.17",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -150,7 +150,14 @@ function proproAuthMiddleware(options = {}, userSchema) {
150
150
 
151
151
  console.log('redirectUrl', redirectUrl);
152
152
 
153
- const urlToRedirect = redirectUrl.includes('app.mapmap.app') ? `https://${redirectUrl}/` : `https://${redirectUrl}/`;
153
+ let urlToRedirect;
154
+
155
+ if (!redirectUrl.startsWith('http://') && !redirectUrl.startsWith('https://')) {
156
+ urlToRedirect = redirectUrl.includes('app.mapmap.app') ? `https://${redirectUrl}/` : `http://${redirectUrl}/`;
157
+ } else {
158
+ urlToRedirect = redirectUrl;
159
+ }
160
+
154
161
 
155
162
  console.log('urlToRedirect', urlToRedirect);
156
163