propro-utils 1.4.33 → 1.4.35

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.33",
3
+ "version": "1.4.35",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -151,24 +151,18 @@ function proproAuthMiddleware(options = {}, userSchema) {
151
151
  maxAge: accessMaxAge,
152
152
  });
153
153
 
154
- // res.cookie('user', JSON.stringify(user), {
155
- // maxAge: accessMaxAge,
156
- // });
157
-
158
- // res.cookie('account', JSON.stringify(account), {
159
- // maxAge: accessMaxAge,
160
- // });
161
-
162
- // req.cookie('isLoggedIn', true, {
163
- // maxAge: accessMaxAge,
164
- // });
154
+ res.cookie('user', JSON.stringify(user), {
155
+ maxAge: accessMaxAge,
156
+ secure: process.env.NODE_ENV === 'production',
157
+ });
165
158
 
166
- console.log('redirectUrl', redirectUrl);
159
+ res.cookie('account', JSON.stringify(account), {
160
+ maxAge: accessMaxAge,
161
+ secure: process.env.NODE_ENV === 'production',
162
+ });
167
163
 
168
164
  const urlToRedirect = formatRedirectUrl(redirectUrl);
169
165
 
170
- console.log('urlToRedirect', urlToRedirect);
171
-
172
166
  return res.redirect(urlToRedirect);
173
167
  }
174
168
  } catch (error) {