Skip to content

feat: Skip double confirmation for authorization#451

Merged
JackZhao10086 merged 1 commit intolarksuite:mainfrom
mazhe-nerd:feature/easy-setup
Apr 14, 2026
Merged

feat: Skip double confirmation for authorization#451
JackZhao10086 merged 1 commit intolarksuite:mainfrom
mazhe-nerd:feature/easy-setup

Conversation

@mazhe-nerd
Copy link
Copy Markdown
Collaborator

@mazhe-nerd mazhe-nerd commented Apr 13, 2026

Summary

  • 移除了 auth login 交互式登录流程中的二次确认步骤(Phase 2:
    confirmation)。用户在选择完域名、权限级别和 scope
    后,不再需要额外确认一次"是否授权",直接进入授权流程。

Changes

  • cmd/auth/login_interactive.go:删除 21 行代码,移除了基于 huh.Confirm
    的确认弹窗逻辑。用户选完配置、打印摘要后直接返回结果,减少一步交互。

Motivation

简化 lark-cli auth login 的首次配置体验(easy-setup),减少不必要的交互摩擦。用户在
前面的步骤中已经明确选择了域名和权限范围,摘要信息也已打印,额外的确认步骤显得冗余。

Test Plan

  • 执行 lark-cli auth login,确认选择域名和权限后能直接完成授权,不再出现确认提示
  • 确认用户在前面步骤中按 Ctrl+C / ESC 仍能正常中止流程

@github-actions github-actions bot added the size/L Large or sensitive change across domains or core paths label Apr 13, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

The change removes the "Phase 2: confirmation" step from the runInteractiveLogin function, eliminating a user confirmation dialog that previously validated login intent. The function now proceeds directly from displaying the summary and scopes to returning the login result.

Changes

Cohort / File(s) Summary
Login Confirmation Removal
cmd/auth/login_interactive.go
Deleted the confirmation phase logic, including the huh.NewConfirm form instantiation and handling of user-abort/unconfirmed outcomes. Function now returns interactiveResult immediately after scope summary display.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 No more delays, just login straight,
The confirmation form sealed its fate,
With scope summary clear and bright,
We bound directly—what a delight!
One less dialog standing in our way,
The rabbit hops through login day! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Skip double confirmation for authorization' is specific and directly related to the main change: removing the confirmation phase from interactive login.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is comprehensive and well-structured with Summary, Changes, Motivation, and Test Plan sections, but uses Chinese and deviates from the English template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 13, 2026

Greptile Summary

This PR removes the Phase 2 confirmation dialog from runInteractiveLogin, so after the user selects domains and permission level and sees the scope summary, the authorization flow proceeds immediately without a second "Confirm authorization?" prompt.

Confidence Score: 5/5

Safe to merge — the change is a clean, intentional UX simplification with one minor dead-code cleanup left behind.

Only finding is a P2 orphaned ConfirmAuth field in loginMsg; no logic errors or correctness issues introduced.

cmd/auth/login_messages.go — ConfirmAuth field and its locale values can be removed as follow-up cleanup.

Important Files Changed

Filename Overview
cmd/auth/login_interactive.go Removes the Phase 2 confirmation dialog from runInteractiveLogin; user proceeds directly to auth after the summary display. Clean removal with no broken references in this file, but leaves loginMsg.ConfirmAuth unused.

Sequence Diagram

sequenceDiagram
    participant U as User
    participant F1 as Form 1 (domain + perm)
    participant S as Scope Summary
    participant A as Auth Flow

    U->>F1: Select domains
    F1->>U: Show permission level selector
    U->>F1: Select permission level
    F1->>S: Compute & print scope summary
    Note over S: (previously: Form 2 confirm dialog here)
    S->>A: Return interactiveResult directly
    A->>U: Open browser / device-code flow
Loading

Comments Outside Diff (1)

  1. cmd/auth/login_interactive.go, line 187-190 (link)

    P2 Orphaned ConfirmAuth field in loginMsg

    With the confirmation form removed, loginMsg.ConfirmAuth (declared in login_messages.go:20, populated in loginMsgZh at line 57 and loginMsgEn at line 92) is now dead code — no reference to it exists anywhere in the codebase. The assertLoginMsgAllFieldsNonEmpty test also checks this field, adding unnecessary test coverage for an unused string. Consider removing the field and its two locale values to keep the struct clean.

Reviews (1): Last reviewed commit: "feat: skip auth check" | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@72ff2fcd2e730d7c0b95908e9d6486fb0c1bc673

🧩 Skill update

npx skills add mazhe-nerd/lark-cli#feature/easy-setup -y -g

@JackZhao10086 JackZhao10086 self-requested a review April 14, 2026 03:36
Copy link
Copy Markdown
Collaborator

@JackZhao10086 JackZhao10086 left a comment

Choose a reason for hiding this comment

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

能减少一次冗余用户交互

@JackZhao10086 JackZhao10086 merged commit 2a30124 into larksuite:main Apr 14, 2026
14 checks passed
@JackZhao10086
Copy link
Copy Markdown
Collaborator

感谢你的贡献

@coderabbitai coderabbitai bot mentioned this pull request Apr 14, 2026
7 tasks
yxzhaao pushed a commit to yxzhaao/cli that referenced this pull request Apr 14, 2026
The secondary confirmation step in the interactive login process has been removed (Phase 2: After the user selects the complete domain name, permission level, and scope, they no longer need to confirm "authorize" again and can directly proceed to the authorization process).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants