Use existing oauth Token struct rather than create our own

This commit is contained in:
Guillaume Tardif 2020-08-10 13:39:03 +02:00
parent 036190bd5e
commit fffb3aa3f9
1 changed files with 3 additions and 4 deletions

View File

@ -26,6 +26,8 @@ import (
"os/exec"
"strings"
"golang.org/x/oauth2"
"github.com/Azure/azure-sdk-for-go/profiles/latest/containerinstance/mgmt/containerinstance"
"github.com/Azure/go-autorest/autorest/to"
compose "github.com/compose-spec/compose-go/types"
@ -167,10 +169,7 @@ func (c cliRegistryHelper) autoLoginAcr(registry string) error {
return err
}
type acrToken struct {
RefreshToken string `json:"refresh_token"`
}
newToken := acrToken{}
newToken := oauth2.Token{}
if err := json.Unmarshal(bits, &newToken); err != nil {
return err
}