Skip to content

Commit

Permalink
add self recover when key not found in keychain
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Jan 10, 2023
1 parent b03bd5f commit b6ce660
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/packages/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cmd
import (
"encoding/base64"
"encoding/hex"
"strings"

"errors"
"fmt"
Expand All @@ -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)
}

Expand Down

0 comments on commit b6ce660

Please sign in to comment.