spotify: avoid duplicated oauth2 config code

This commit is contained in:
Philipp Wolfer 2025-07-14 12:04:52 +02:00
parent 499786cab9
commit 614df100ac

View file

@ -62,19 +62,7 @@ func (b *SpotifyApiBackend) InitConfig(config *config.ServiceConfig) error {
} }
func (b *SpotifyApiBackend) OAuth2Strategy(redirectURL *url.URL) auth.OAuth2Strategy { func (b *SpotifyApiBackend) OAuth2Strategy(redirectURL *url.URL) auth.OAuth2Strategy {
conf := oauth2.Config{ conf := b.OAuth2Config(redirectURL)
ClientID: b.clientID,
ClientSecret: b.clientSecret,
Scopes: []string{
"user-read-currently-playing",
"user-read-recently-played",
"user-library-read",
"user-library-modify",
},
RedirectURL: redirectURL.String(),
Endpoint: spotify.Endpoint,
}
return auth.NewStandardStrategy(conf) return auth.NewStandardStrategy(conf)
} }