v0.7.1 client readline removed for cross-platform compatibility with wasm, client logic fix fixes and refactor
This commit is contained in:
20
internal/client/command/pass_unix.go
Normal file
20
internal/client/command/pass_unix.go
Normal file
@ -0,0 +1,20 @@
|
||||
// FILE: internal/client/command/auth_unix.go
|
||||
//go:build !js && !wasm
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
func readPassword(prompt string) (string, error) {
|
||||
fmt.Print(prompt)
|
||||
bytePassword, err := term.ReadPassword(0) // 0 is stdin
|
||||
fmt.Println()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(bytePassword), nil
|
||||
}
|
||||
Reference in New Issue
Block a user