From e9f1af44bd87423f8c0e316ccd6b7b226b0e95da Mon Sep 17 00:00:00 2001 From: Brian Strauch Date: Tue, 29 Jun 2021 22:59:47 -0500 Subject: [PATCH] bump api version --- go.mod | 2 +- go.sum | 4 ++-- internal/common.go | 2 +- internal/login/login.go | 4 ++-- main.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index a0d33bb..0089d06 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/blang/semver v3.5.1+incompatible - github.com/brianstrauch/spotify v0.3.0 + github.com/brianstrauch/spotify v0.3.1 github.com/pkg/browser v0.0.0-20210606212950-a7b7a6107d32 github.com/rhysd/go-github-selfupdate v1.2.3 github.com/spf13/cobra v1.1.3 diff --git a/go.sum b/go.sum index d4af17e..8f5151e 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/brianstrauch/spotify v0.3.0 h1:09iAmmn3pncnCdHOghiBH2r619HkWt35j59yEBXwUt0= -github.com/brianstrauch/spotify v0.3.0/go.mod h1:sImRT74obai+LNgFVxr+qNVq2yt5KEfvNxz6ZDfYWaA= +github.com/brianstrauch/spotify v0.3.1 h1:IBd0vkal0bs+yilvp+6VR4aL9q94qiionwYHETcOHS4= +github.com/brianstrauch/spotify v0.3.1/go.mod h1:sImRT74obai+LNgFVxr+qNVq2yt5KEfvNxz6ZDfYWaA= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= diff --git a/internal/common.go b/internal/common.go index 4d92cc1..8e433ca 100644 --- a/internal/common.go +++ b/internal/common.go @@ -28,7 +28,7 @@ func Authenticate() (*spotify.API, error) { func refresh() error { refresh := viper.GetString("refresh_token") - token, err := spotify.RefreshToken(refresh, ClientID) + token, err := spotify.RefreshPKCEToken(refresh, ClientID) if err != nil { return err } diff --git a/internal/login/login.go b/internal/login/login.go index 8960287..c18e26e 100644 --- a/internal/login/login.go +++ b/internal/login/login.go @@ -56,7 +56,7 @@ func NewCommand() *cobra.Command { func login() (*spotify.Token, error) { // 1. Create the code verifier and challenge - verifier, challenge, err := spotify.CreateVerifierAndChallenge() + verifier, challenge, err := spotify.CreatePKCEVerifierAndChallenge() if err != nil { return nil, err } @@ -73,7 +73,7 @@ func login() (*spotify.Token, error) { spotify.ScopeUserReadPlaybackState, } - uri := spotify.BuildAuthURI(internal.ClientID, RedirectURI, challenge, state, scopes...) + uri := spotify.BuildPKCEAuthURI(internal.ClientID, RedirectURI, challenge, state, scopes...) // 3. Your app redirects the user to the authorization URI if err := browser.OpenURL(uri); err != nil { diff --git a/main.go b/main.go index 0210e1f..e91cab0 100644 --- a/main.go +++ b/main.go @@ -32,7 +32,7 @@ func main() { root := &cobra.Command{ Use: "spotify", Short: "Spotify for the terminal 🎵", - Version: "1.8.1", + Version: "1.8.2", PersistentPreRunE: promptUpdate, }