Skip to content

Commit

Permalink
fix(auth): handle cancellation of auth polling
Browse files Browse the repository at this point in the history
  • Loading branch information
rektdeckard committed Aug 10, 2024
1 parent 00f3300 commit fe0c258
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/lk/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ func tryAuthIfNeeded(ctx context.Context, cmd *cli.Command) error {

// poll for keys
fmt.Printf("Please confirm access by visiting:\n\n %s\n\n", authURL.String())

if err := browser.OpenURL(authURL.String()); err != nil {
return err
}
Expand All @@ -254,10 +253,12 @@ func tryAuthIfNeeded(ctx context.Context, cmd *cli.Command) error {
Run(); err != nil {
return err
}

if pollErr != nil {
return pollErr
}
if key == nil {
return errors.New("operation cancelled")
}

var isDefault bool
if err := huh.NewConfirm().
Expand Down

0 comments on commit fe0c258

Please sign in to comment.