@lightcone-ai/daemon 0.9.55 → 0.9.56
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 +1 -1
- package/src/browser-login.js +8 -1
package/package.json
CHANGED
package/src/browser-login.js
CHANGED
|
@@ -256,9 +256,16 @@ export class BrowserLoginSession {
|
|
|
256
256
|
// Export decrypted cookies to cookies.json so chrome-pool can inject them
|
|
257
257
|
// without relying on platform-specific keychain encryption (fixes macOS cross-process issue)
|
|
258
258
|
try {
|
|
259
|
+
// For XHS: also visit creator subdomain so it sets its own session tokens
|
|
260
|
+
// before we snapshot cookies — otherwise creator.xiaohongshu.com rejects the session
|
|
261
|
+
if (this._platform === 'xhs') {
|
|
262
|
+
await this.send('Page.navigate', { url: 'https://creator.xiaohongshu.com' });
|
|
263
|
+
await sleep(4000);
|
|
264
|
+
}
|
|
259
265
|
const cookieResult = await this.send('Network.getAllCookies', {});
|
|
266
|
+
const baseDomain = new URL(this._config.loginUrl).hostname.split('.').slice(-2).join('.');
|
|
260
267
|
const cookies = (cookieResult.cookies ?? []).filter(c =>
|
|
261
|
-
c.domain.includes(
|
|
268
|
+
c.domain.includes(baseDomain)
|
|
262
269
|
);
|
|
263
270
|
writeFileSync(path.join(this._profileDir, 'cookies.json'), JSON.stringify(cookies));
|
|
264
271
|
console.log(`[BrowserLogin][${this._platform}] Saved ${cookies.length} cookies to cookies.json`);
|