From b6ce660a3c78445cb575c55cc4fdc419ddeec2d9 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Mon, 9 Jan 2023 19:22:03 -0500 Subject: [PATCH] add self recover when key not found in keychain --- cli/packages/cmd/login.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/packages/cmd/login.go b/cli/packages/cmd/login.go index 923782e3f..26ec348d2 100644 --- a/cli/packages/cmd/login.go +++ b/cli/packages/cmd/login.go @@ -6,6 +6,7 @@ package cmd import ( "encoding/base64" "encoding/hex" + "strings" "errors" "fmt" @@ -31,7 +32,9 @@ var loginCmd = &cobra.Command{ PreRun: toggleDebug, Run: func(cmd *cobra.Command, args []string) { 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) }