mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-09-01 22:57:25 -04:00
Announce TOTP code has been copied only after the entry has already been decrypted
This commit is contained in:
+5
-2
@@ -3,11 +3,12 @@ package backend
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
steamtotp "github.com/fortis/go-steam-totp"
|
|
||||||
"github.com/pquerna/otp/totp"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
steamtotp "github.com/fortis/go-steam-totp"
|
||||||
|
"github.com/pquerna/otp/totp"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CopyArgument copies a field from an entry to the clipboard
|
// CopyArgument copies a field from an entry to the clipboard
|
||||||
@@ -39,6 +40,8 @@ func CopyArgument(executableName, targetLocation string, field int) {
|
|||||||
secret = decryptedEntry[2]
|
secret = decryptedEntry[2]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println("TOTP code has been copied to the clipboard - your clipboard will be kept up to date with the current code until this process is closed")
|
||||||
|
|
||||||
for { // keep field copied to clipboard, refresh on 30-second intervals
|
for { // keep field copied to clipboard, refresh on 30-second intervals
|
||||||
currentTime := time.Now()
|
currentTime := time.Now()
|
||||||
copyField("", GenTOTP(secret, currentTime, forSteam))
|
copyField("", GenTOTP(secret, currentTime, forSteam))
|
||||||
|
|||||||
Reference in New Issue
Block a user