Skip to content

feat: browser-based login and --token flag for connect auth#98

Merged
lee-reinhardt merged 1 commit intomainfrom
lee-eng-1502-cli
Mar 13, 2026
Merged

feat: browser-based login and --token flag for connect auth#98
lee-reinhardt merged 1 commit intomainfrom
lee-eng-1502-cli

Conversation

@lee-reinhardt
Copy link
Member

Summary

  • Default avocado connect auth login now opens a browser-based flow — supports OAuth-only accounts (e.g. Google SSO domains)
  • CLI binds localhost TCP, prints URL, waits for browser callback, exchanges one-time code for API token, saves profile
  • New --token flag for direct PAT login (validates via GET /api/me, no browser needed)
  • Removed --email and --password flags, LoginClient, and CsrfResponse (dead code)
  • CSRF protection via random state parameter validated on callback

Test plan

  • avocado connect auth login → browser opens → sign in → CLI receives token and saves profile
  • avocado connect auth login --token <pat> → validates and saves without browser
  • avocado connect auth login --profile staging --url https://staging.peridio.com → correct profile saved
  • Verify --help shows updated flags (no --email/--password, has --token)
  • cargo clippy passes with zero warnings

replace email+password login with browser-based OAuth flow as the default
for `avocado connect auth login`. CLI binds a localhost TCP listener,
prints a URL, waits for the browser callback, exchanges the one-time
code for an API token, and saves the profile.

add --token flag for direct PAT-based login (validates via GET /api/me).

remove --email and --password flags, LoginClient, and CsrfResponse
(dead code after dropping the password flow).
@lee-reinhardt lee-reinhardt merged commit adaa0cf into main Mar 13, 2026
5 checks passed
@lee-reinhardt lee-reinhardt deleted the lee-eng-1502-cli branch March 13, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants