propro-utils 1.4.31 → 1.4.33

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.31",
3
+ "version": "1.4.33",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -128,16 +128,7 @@ function proproAuthMiddleware(options = {}, userSchema) {
128
128
  redirectUri
129
129
  );
130
130
 
131
- console.log(
132
- 'tokens',
133
- tokens,
134
- 'account',
135
- account,
136
- 'redirectUrl',
137
- redirectUrl
138
- );
139
131
  const user = await checkIfUserExists(userSchema, account.accountId);
140
- console.log('user', user);
141
132
 
142
133
  const currentDateTime = new Date();
143
134
 
@@ -160,29 +151,24 @@ function proproAuthMiddleware(options = {}, userSchema) {
160
151
  maxAge: accessMaxAge,
161
152
  });
162
153
 
163
- console.log(
164
- 'user',
165
- user,
166
- 'account',
167
- account,
168
- 'redirectUrl',
169
- redirectUrl
170
- );
154
+ // res.cookie('user', JSON.stringify(user), {
155
+ // maxAge: accessMaxAge,
156
+ // });
171
157
 
172
- res.cookie('user', JSON.stringify(user), {
173
- maxAge: accessMaxAge,
174
- });
158
+ // res.cookie('account', JSON.stringify(account), {
159
+ // maxAge: accessMaxAge,
160
+ // });
175
161
 
176
- res.cookie('account', JSON.stringify(account), {
177
- maxAge: accessMaxAge,
178
- });
162
+ // req.cookie('isLoggedIn', true, {
163
+ // maxAge: accessMaxAge,
164
+ // });
179
165
 
180
- req.cookie('isLoggedIn', true, {
181
- maxAge: accessMaxAge,
182
- });
166
+ console.log('redirectUrl', redirectUrl);
183
167
 
184
168
  const urlToRedirect = formatRedirectUrl(redirectUrl);
185
169
 
170
+ console.log('urlToRedirect', urlToRedirect);
171
+
186
172
  return res.redirect(urlToRedirect);
187
173
  }
188
174
  } catch (error) {
@@ -160,6 +160,8 @@ function formatRedirectUrl(redirectUrl) {
160
160
  urlToRedirect = redirectUrl;
161
161
  }
162
162
 
163
+ console.log('Redirect URL:', urlToRedirect);
164
+
163
165
  return urlToRedirect;
164
166
  }
165
167