mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-05-12 10:58:21 +00:00
fix totp retry count, adjust newline printing
This commit is contained in:
parent
99d2706af8
commit
8044fbbe19
1 changed files with 3 additions and 3 deletions
|
@ -66,16 +66,16 @@ func GetClient(ctx context.Context) (*api.Client, error) {
|
||||||
if challange.Provider.TOTP == "" {
|
if challange.Provider.TOTP == "" {
|
||||||
return http.Cookie{}, fmt.Errorf("Server Provided no TOTP Provider")
|
return http.Cookie{}, fmt.Errorf("Server Provided no TOTP Provider")
|
||||||
}
|
}
|
||||||
for {
|
for i := 0; i < 3; i++ {
|
||||||
var code string
|
var code string
|
||||||
fmt.Print("Enter TOTP:")
|
fmt.Print("Enter TOTP:")
|
||||||
bytepw, err := term.ReadPassword(int(syscall.Stdin))
|
bytepw, err := term.ReadPassword(int(syscall.Stdin))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("\n")
|
fmt.Printf("\n")
|
||||||
return http.Cookie{}, fmt.Errorf("Reading TOTP: %w", err)
|
return http.Cookie{}, fmt.Errorf("Reading TOTP: %w", err)
|
||||||
}
|
}
|
||||||
code = string(bytepw)
|
code = string(bytepw)
|
||||||
fmt.Println("\n")
|
fmt.Printf("\n")
|
||||||
req := api.MFAChallangeResponse{
|
req := api.MFAChallangeResponse{
|
||||||
TOTP: code,
|
TOTP: code,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue