v0.7.1 client readline removed for cross-platform compatibility with wasm, client logic fix fixes and refactor

This commit is contained in:
2025-11-13 14:31:31 -05:00
parent 6bdc061508
commit 35c49b22b6
18 changed files with 306 additions and 272 deletions

View File

@ -0,0 +1,29 @@
// FILE: lixenwraith/chess/internal/client/command/auth_wasm.go
//go:build js && wasm
package command
import (
"bufio"
"fmt"
"os"
"strings"
"chess/internal/client/display"
)
func readPassword(prompt string) (string, error) {
display.Println(display.Red, "(warning: password visible in browser)")
display.Print(display.Yellow, prompt)
// In WASM/browser, password masking must be handled by JavaScript/xterm.js
// This is fallback with visible input
scanner := bufio.NewScanner(os.Stdin)
if scanner.Scan() {
return strings.TrimSpace(scanner.Text()), nil
}
if err := scanner.Err(); err != nil {
return "", err
}
return "", fmt.Errorf("no input received")
}