propro-utils 1.7.5 → 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
|
@@ -159,29 +159,38 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
|
|
|
159
159
|
try {
|
|
160
160
|
Object.entries({ ...httpOnlyCookies, ...regularCookies }).forEach(
|
|
161
161
|
([name, config]) => {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
const extensionCookiePromises = Object.entries({
|
|
177
|
+
...httpOnlyCookies,
|
|
178
|
+
...regularCookies,
|
|
179
|
+
}).map(([name, config]) => {
|
|
180
|
+
return setChromeExtensionCookie({
|
|
181
|
+
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
|
+
});
|
|
191
|
+
});
|
|
183
192
|
|
|
184
|
-
|
|
193
|
+
await Promise.allSettled(extensionCookiePromises);
|
|
185
194
|
|
|
186
195
|
console.log('Auth cookies set successfully', {
|
|
187
196
|
domain,
|