propro-utils 1.4.44 → 1.4.45

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.44",
3
+ "version": "1.4.45",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -72,6 +72,9 @@ function proproAuthMiddleware(options = {}, userSchema) {
72
72
  const formatedAuthUrl = formatRedirectUrl(authUrl);
73
73
 
74
74
  let response;
75
+ let account;
76
+ let access;
77
+ let refresh;
75
78
 
76
79
  try {
77
80
  response = await post(
@@ -85,12 +88,12 @@ function proproAuthMiddleware(options = {}, userSchema) {
85
88
  },
86
89
  }
87
90
  );
91
+
92
+ ({ account, access, refresh } = response.data);
88
93
  } catch (error) {
89
94
  console.error('an error occur: ', error.message);
90
95
  }
91
96
 
92
- const { account, access, refresh } = response.data;
93
-
94
97
  if (!account || !access || !refresh) {
95
98
  return res
96
99
  .status(401)