commit cdccc7f565ed35bf7411dbb2ddefa173e774c00b
parent 17a42c2260d12d259f24206026fad1c46d2834ff
Author: Sean Enck <sean@ttypty.com>
Date: Wed, 13 Jul 2022 19:58:38 -0400
default to a value for totp keys
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/cmd/lb-totp/main.go b/cmd/lb-totp/main.go
@@ -25,7 +25,7 @@ func list() ([]string, error) {
}
dir := strings.TrimPrefix(filepath.Dir(path), store)
if strings.HasSuffix(dir, "/") {
- dir = dir[0:len(dir)-1]
+ dir = dir[0 : len(dir)-1]
}
if strings.HasPrefix(dir, "/") {
dir = dir[1:]
@@ -56,7 +56,11 @@ func clear() {
}
func totpToken() string {
- return os.Getenv("LOCKBOX_TOTP") + internal.Extension
+ t := os.Getenv("LOCKBOX_TOTP")
+ if t == "" {
+ t = "totp"
+ }
+ return t + internal.Extension
}
func display(token string, clip, once, short bool) error {