propro-utils 1.3.35 → 1.3.37

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.3.35",
3
+ "version": "1.3.37",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@ function proproAuthMiddleware(options = {}, userSchema) {
32
32
 
33
33
  return async (req, res, next) => {
34
34
  try {
35
- if (!["/api/auth", "/api/callback"].includes(req.path)) {
35
+ if (!["/api/auth", "/api/callback", "/api/refreshToken"].includes(req.path)) {
36
36
  return next();
37
37
  }
38
38
 
@@ -53,7 +53,9 @@ function proproAuthMiddleware(options = {}, userSchema) {
53
53
  const {accountData, access, refresh} = await post(`${authUrl}/api/v1/auth/refreshTokens`, {
54
54
  refreshToken
55
55
  }, {
56
- actionType: "refresh",
56
+ params: {
57
+ actionType: "refresh",
58
+ }
57
59
  });
58
60
 
59
61
 
@@ -117,7 +119,7 @@ function proproAuthMiddleware(options = {}, userSchema) {
117
119
  return res.redirect(urlToRedirect);
118
120
  }
119
121
  } catch (error) {
120
- console.error("Error in proproAuthMiddleware:", error);
122
+ // console.error("Error in proproAuthMiddleware:", error);
121
123
  res.status(401).send("Unauthorized: Invalid or expired token");
122
124
  }
123
125
  };