Remove use-copy-paste option from autotype
This commit is contained in:
parent
04d2357f3c
commit
5a40f237a7
4 changed files with 3 additions and 21 deletions
|
|
@ -49,7 +49,7 @@ func ListLogins(client client.Client) ([]messages.DecryptedLoginCipher, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Run(layout string, useCopyPaste bool, client client.Client) {
|
func Run(layout string, client client.Client) {
|
||||||
logins, err := ListLogins(client)
|
logins, err := ListLogins(client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
@ -70,15 +70,7 @@ func Run(layout string, useCopyPaste bool, client client.Client) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if useCopyPaste {
|
autotype.TypeString(string(login.Username)+"\t"+string(login.Password), layout)
|
||||||
clipboard.WriteAll(string(login.Username))
|
|
||||||
autotype.Paste(layout)
|
|
||||||
autotype.TypeString("\t", layout)
|
|
||||||
clipboard.WriteAll(login.Password)
|
|
||||||
autotype.Paste(layout)
|
|
||||||
} else {
|
|
||||||
autotype.TypeString(string(login.Username)+"\t"+string(login.Password), layout)
|
|
||||||
}
|
|
||||||
|
|
||||||
clipboard.WriteAll(login.TwoFactorCode)
|
clipboard.WriteAll(login.TwoFactorCode)
|
||||||
c <- true
|
c <- true
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,3 @@ func TypeString(textToType string, layout string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Paste(layout string) error {
|
|
||||||
fmt.Println("Not implemented")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,3 @@ import "github.com/quexten/goldwarden/autofill/autotype/uinput"
|
||||||
func TypeString(text string, layout string) error {
|
func TypeString(text string, layout string) error {
|
||||||
return uinput.TypeString(text, layout)
|
return uinput.TypeString(text, layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Paste(layout string) error {
|
|
||||||
return uinput.Paste(layout)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,7 @@ var autofillCmd = &cobra.Command{
|
||||||
Long: `Autofill credentials`,
|
Long: `Autofill credentials`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
layout := cmd.Flag("layout").Value.String()
|
layout := cmd.Flag("layout").Value.String()
|
||||||
useCopyPaste, _ := cmd.Flags().GetBool("use-copy-paste")
|
autofill.Run(layout, commandClient)
|
||||||
autofill.Run(layout, useCopyPaste, commandClient)
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue