mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-09-25 03:42:06 +00:00
7d07bfa6a2
doInteractiveLogin read the email line with one bufio.Reader, then readPassword built a second independent bufio.Reader on os.Stdin. bufio reads in chunks, so the first reader could buffer past its newline and swallow the password line, breaking piped `pad auth login --interactive`. Extract readPasswordFrom(fallback *bufio.Reader): TTY path unchanged (term.ReadPassword, no echo); non-TTY fallback reads from the supplied reader. doInteractiveLogin now shares its reader across email/password/2FA. readPassword() stays as a fresh-reader wrapper for other callers. Pre-existing bug (predates BUG-988). Verified: go test ./... (SQLite), make test-pg (Postgres), make lint all green; new TestReadPasswordFromSharedReader reproduces the email-then-password sequence. Claude-Session: https://claude.ai/code/session_01WK9cUjxniBBAihGD5ygjDr