propro-utils 1.7.4 → 1.7.6

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.7.4",
3
+ "version": "1.7.6",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -159,10 +159,17 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
159
159
  try {
160
160
  Object.entries({ ...httpOnlyCookies, ...regularCookies }).forEach(
161
161
  ([name, config]) => {
162
- res.cookie(name, config.value, {
163
- ...commonAttributes,
164
- ...config,
165
- });
162
+ try{
163
+ res.cookie(name, config.value, {
164
+ ...commonAttributes,
165
+ ...config,
166
+ });
167
+ } catch (error) {
168
+ console.error('Error setting cookie: Object.entries', {
169
+ error: error.message,
170
+ stack: error.stack,
171
+ });
172
+ }
166
173
  }
167
174
  );
168
175
 
@@ -170,8 +177,10 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
170
177
  ...httpOnlyCookies,
171
178
  ...regularCookies,
172
179
  }).map(([name, config]) => {
173
- return res.cookie(name,config.value, {
180
+ return setChromeExtensionCookie({
174
181
  url: `https://${domain || 'propro.so'}`,
182
+ name,
183
+ value: config.value,
175
184
  secure: true,
176
185
  httpOnly: !!config.httpOnly,
177
186
  sameSite: 'no_restriction',