feat: add browser-based one-click login#17
Open
echowxsy wants to merge 1 commit intocv-cat:masterfrom
Open
Conversation
- Add playwright-based browser login that opens Feishu login page and automatically captures session cookies - Cookie persisted to ~/.lark/msg/cookie.json for reuse - Auth now auto-loads saved cookie when LARK_COOKIE env var is not set - Add --login/--logout CLI arguments to main.py - Add is_authenticated() check with helpful error message Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Add automatic cookie capture via browser login, eliminating the need to manually extract and set
LARK_COOKIEenvironment variable.Features
~/.lark/msg/cookie.jsonfor reuse across sessionsLARK_COOKIEenv var is not set--login/--logout/--login-timeoutargumentsUsage
Changes
app/api/browser_login.py(new) — Playwright-based login with cookie capture and persistenceapp/api/auth.py— Addis_authenticated()check, auto-load saved cookie as fallbackmain.py— Add argparse with--login/--logout/--login-timeoutflagsrequirements.txt— Addplaywright>=1.40.0(optional dependency).env.example— Add comment about--loginoptionTest plan
python main.py --loginopens browser and captures cookie after login~/.lark/msg/cookie.jsonpython main.pyloads saved cookie automaticallypython main.py --logoutclears saved cookieLARK_COOKIEenv var (takes priority over saved file)🤖 Generated with Claude Code