diff options
author | Cara Salter <cara@devcara.com> | 2023-04-15 14:14:59 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2023-04-15 14:14:59 -0400 |
commit | e0834b07c05ee5865ef049b30c9728f12f080eff (patch) | |
tree | aac7cad20697ed39df5ffc7c2ec8a6791eb7a5a1 | |
parent | 8727e502f8e77dab1e3cae54d0ce41b1d677f984 (diff) | |
download | 142bot-web-e0834b07c05ee5865ef049b30c9728f12f080eff.tar.gz 142bot-web-e0834b07c05ee5865ef049b30c9728f12f080eff.zip |
apparently having the write scope doesn't imply read
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | main.go | 4 |
2 files changed, 4 insertions, 1 deletions
@@ -28,3 +28,4 @@ go.work # End of https://www.toptal.com/developers/gitignore/api/dotenv,go +142bot-web @@ -82,6 +82,8 @@ func SpotifyAuth(w http.ResponseWriter, r *http.Request) { logoru.Error(err.Error()) return } + + http.Redirect(w, r, "/success", http.StatusFound) } func main() { @@ -93,7 +95,7 @@ func main() { spotifyConfig = oauth2.Config{ ClientID: os.Getenv("SPOTIFY_CLIENT_ID"), ClientSecret: os.Getenv("SPOTIFY_CLIENT_SECRET"), - Scopes: []string{"user-modify-playback-state", "user-read-email"}, + Scopes: []string{"user-modify-playback-state", "user-read-playback-state", "user-read-email"}, RedirectURL: fmt.Sprintf("%s/oauth/spotify", os.Getenv("BASE_URL")), Endpoint: endpoints.Spotify, } |