add self recover when key not found in keychain

This commit is contained in:
Maidul Islam
2023-01-09 19:22:03 -05:00
parent b03bd5fa08
commit b6ce660a3c
+4 -1
View File
@@ -6,6 +6,7 @@ package cmd
import ( import (
"encoding/base64" "encoding/base64"
"encoding/hex" "encoding/hex"
"strings"
"errors" "errors"
"fmt" "fmt"
@@ -31,7 +32,9 @@ var loginCmd = &cobra.Command{
PreRun: toggleDebug, PreRun: toggleDebug,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
currentLoggedInUserDetails, err := util.GetCurrentLoggedInUserDetails() currentLoggedInUserDetails, err := util.GetCurrentLoggedInUserDetails()
if err != nil { if strings.Contains(err.Error(), "The specified item could not be found in the keyring") { // if the key can't be found allow them to override
log.Debug(err)
} else {
util.HandleError(err) util.HandleError(err)
} }