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")