Skip to content

Commit

Permalink
Adding loggins
Browse files Browse the repository at this point in the history
  • Loading branch information
willvedd committed Dec 2, 2022
1 parent 17080d2 commit fb97cbb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/cli/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,16 @@ func apiCmdRun(cli *cli, inputs *apiCmdInputs) func(cmd *cobra.Command, args []s
}

bearerToken := cli.config.Tenants[cli.tenant].AccessToken

if bearerToken == "" {
return errors.New("missing access token associated with tenant. Please re-authenticate by running `auth0 login`")
}

cli.renderer.Infof("%+v", cli.config.Tenants)
cli.renderer.Infof("====================")
cli.renderer.Infof("%+v", cli.tenant)
cli.renderer.Infof("====================")
cli.renderer.Infof("%+v", cli.config.Tenants[cli.tenant])

request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", bearerToken))
request.Header.Set("Content-Type", "application/json")
request.Header.Set("User-Agent", fmt.Sprintf("%s/%s", userAgent, strings.TrimPrefix(buildinfo.Version, "v")))
Expand Down

0 comments on commit fb97cbb

Please sign in to comment.