Skip to content

Commit

Permalink
Cleaning up api command implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
willvedd committed Feb 10, 2023
1 parent 9fc0b6f commit 08ab2b6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/cli/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 08ab2b6

Please sign in to comment.