From 08ab2b6159fefc104a0997df3e1734b1c8e9307b Mon Sep 17 00:00:00 2001 From: Will Vedder Date: Fri, 10 Feb 2023 13:57:24 -0500 Subject: [PATCH] Cleaning up api command implementation --- internal/cli/api.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/cli/api.go b/internal/cli/api.go index 4e5a75e13..8e1f4d55c 100644 --- a/internal/cli/api.go +++ b/internal/cli/api.go @@ -15,7 +15,6 @@ import ( "github.com/auth0/auth0-cli/internal/buildinfo" "github.com/auth0/auth0-cli/internal/display" "github.com/auth0/auth0-cli/internal/iostream" - "github.com/auth0/auth0-cli/internal/keyring" "github.com/auth0/auth0-cli/internal/prompt" ) @@ -142,10 +141,7 @@ func apiCmdRun(cli *cli, inputs *apiCmdInputs) func(cmd *cobra.Command, args []s return err } - accessToken, err := keyring.GetAccessToken(cli.tenant) - if err != nil { - accessToken = cli.config.Tenants[cli.tenant].AccessToken - } + accessToken := getAccessToken(Tenant{Domain: cli.tenant, AccessToken: cli.config.Tenants[cli.tenant].AccessToken}) request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", accessToken)) request.Header.Set("Content-Type", "application/json")