feat: implement automatic auth credential updates#21
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_UPDATEconfiguration 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.
18fd869 to
1919407
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文说明
功能更新:
auth-x.json的功能,防止会话过期。配置项:
ENABLE_AUTH_UPDATE(默认false)。true时,才会在登录成功或每 24 小时自动更新 Auth 文件。English Summary
Features:
auth-x.jsonto prevent session expiration.Configuration:
ENABLE_AUTH_UPDATEenvironment variable (default:false).true.follow-up pr #23