Announce TOTP code has been copied only after the entry has already been decrypted

This commit is contained in:
2024-07-30 18:32:14 -04:00
parent 2904c76ffb
commit b7a470116a
2 changed files with 5 additions and 3 deletions
-1
View File
@@ -74,7 +74,6 @@ func main() {
case "username", "-u":
field = 1
case "totp", "-t":
fmt.Println("TOTP code will be copied to clipboard - your clipboard will be kept up to date with the current TOTP code until this process is closed")
field = 2
case "url", "-l":
field = 3
+5 -2
View File
@@ -3,11 +3,12 @@ package backend
import (
"bufio"
"fmt"
steamtotp "github.com/fortis/go-steam-totp"
"github.com/pquerna/otp/totp"
"os"
"strings"
"time"
steamtotp "github.com/fortis/go-steam-totp"
"github.com/pquerna/otp/totp"
)
// CopyArgument copies a field from an entry to the clipboard
@@ -39,6 +40,8 @@ func CopyArgument(executableName, targetLocation string, field int) {
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
currentTime := time.Now()
copyField("", GenTOTP(secret, currentTime, forSteam))