summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2023-04-15 14:14:59 -0400
committerCara Salter <cara@devcara.com>2023-04-15 14:14:59 -0400
commite0834b07c05ee5865ef049b30c9728f12f080eff (patch)
treeaac7cad20697ed39df5ffc7c2ec8a6791eb7a5a1
parent8727e502f8e77dab1e3cae54d0ce41b1d677f984 (diff)
download142bot-web-master.tar.gz
142bot-web-master.zip
Add read scopes to authHEADmaster
apparently having the write scope doesn't imply read
-rw-r--r--.gitignore1
-rw-r--r--main.go4
2 files changed, 4 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 70fa4df..a26e30f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,4 @@
go.work
# End of https://www.toptal.com/developers/gitignore/api/dotenv,go
+142bot-web
diff --git a/main.go b/main.go
index c51a301..75d5a2d 100644
--- a/main.go
+++ b/main.go
@@ -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,
}