Skip to content

Conversation

@bbbugg
Copy link
Member

@bbbugg bbbugg commented Jan 16, 2026

中文说明

功能更新:

  1. 自动凭证更新: 实现了将最新的 Cookie 和 LocalStorage 自动写回 auth-x.json 的功能,防止会话过期。

配置项:

  • 新增环境变量 ENABLE_AUTH_UPDATE(默认 false)。
  • 仅当设置为 true 时,才会在登录成功或每 24 小时自动更新 Auth 文件。

English Summary

Features:

  1. Auto Credential Persistence: Implemented automatic write-back of fresh Cookies/LocalStorage to auth-x.json to prevent session expiration.

Configuration:

  • Added ENABLE_AUTH_UPDATE environment variable (default: false).
  • Auth files are only updated on login or every 24 hours when this is set to true.

follow-up pr #23

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements an automatic authentication credential update feature that periodically saves refreshed cookies and localStorage back to auth-x.json files to prevent session expiration. The feature is controlled by a new ENABLE_AUTH_UPDATE environment variable (default: false) and triggers updates on successful login/account switch and every 24 hours via the health monitor.

Changes:

  • Added ENABLE_AUTH_UPDATE configuration flag with environment variable parsing
  • Implemented _updateAuthFile() method to write current browser storage state back to auth files
  • Integrated periodic auth updates (24-hour interval) into the health monitor
  • Updated documentation in both English and Chinese READMEs

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/utils/ConfigLoader.js Adds enableAuthUpdate config property with environment variable parsing and logging
src/core/BrowserManager.js Implements _updateAuthFile() method and integrates auth updates on login and every 24 hours
src/auth/AuthSource.js Improves error message clarity by adding "(parse error)" label
README.md Documents new ENABLE_AUTH_UPDATE environment variable in Chinese
README_EN.md Documents new ENABLE_AUTH_UPDATE environment variable in English

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

🎉 此 PR 的修改已在版本 v0.4.0 中发布。
🎉 The changes in this PR have been released in version v0.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[建议]: 增加 Auth 凭证自动回写/保活功能,实现长期免维护

2 participants