Replace usages of term.ReadPassword with util.ReadPassword

This commit is contained in:
Samuel Lorch 2022-05-30 17:52:17 +02:00
parent bfbc15bd0d
commit 440f41a2af
3 changed files with 5 additions and 10 deletions

View file

@ -97,12 +97,11 @@ func GetClient(ctx context.Context) (*api.Client, error) {
for i := 0; i < 3; i++ {
var code string
fmt.Print("Enter TOTP:")
bytepw, err := term.ReadPassword(int(syscall.Stdin))
code, err := ReadPassword()
if err != nil {
fmt.Printf("\n")
return http.Cookie{}, fmt.Errorf("Reading TOTP: %w", err)
}
code = string(bytepw)
fmt.Printf("\n")
req := api.MFAChallangeResponse{
TOTP: code,