propro-utils 1.7.6 → 1.7.7

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.6",
3
+ "version": "1.7.7",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -177,16 +177,22 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
177
177
  ...httpOnlyCookies,
178
178
  ...regularCookies,
179
179
  }).map(([name, config]) => {
180
- return setChromeExtensionCookie({
180
+ if(chrome?.cookies?.set)
181
+ return setChromeExtensionCookie({
182
+ url: `https://${domain || 'propro.so'}`,
183
+ name,
184
+ value: config.value,
185
+ secure: true,
186
+ httpOnly: !!config.httpOnly,
187
+ sameSite: 'no_restriction',
188
+ path: '/',
189
+ expirationDate: Math.floor((Date.now() + config.maxAge) / 1000),
190
+ domain: domain?.startsWith('.') ? domain : `.${domain || 'propro.so'}`,
191
+ });
192
+ return res.cookie(name, config.value, {
193
+ ...commonAttributes,
194
+ ...config,
181
195
  url: `https://${domain || 'propro.so'}`,
182
- name,
183
- value: config.value,
184
- secure: true,
185
- httpOnly: !!config.httpOnly,
186
- sameSite: 'no_restriction',
187
- path: '/',
188
- expirationDate: Math.floor((Date.now() + config.maxAge) / 1000),
189
- domain: domain?.startsWith('.') ? domain : `.${domain || 'propro.so'}`,
190
196
  });
191
197
  });
192
198