propro-utils 1.4.65 → 1.4.67

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.65",
3
+ "version": "1.4.67",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -128,7 +128,11 @@ function proproAuthMiddleware(options = {}, userSchema) {
128
128
  const setCookies = res.getHeader('Set-Cookie');
129
129
  console.log('Set-Cookies: ', setCookies);
130
130
 
131
- return res.redirect(redirectUrl);
131
+ console.log('Redirect URL: ', redirectUrl);
132
+
133
+ const urlToRedirect = formatRedirectUrl(redirectUrl);
134
+
135
+ return res.redirect(urlToRedirect);
132
136
  }
133
137
  } catch (error) {
134
138
  console.log('Unauthorized: ', error.message);