mirror of
https://git.sr.ht/~phw/scotty
synced 2025-07-15 21:03:35 +02:00
spotify: avoid duplicated oauth2 config code
This commit is contained in:
parent
499786cab9
commit
614df100ac
1 changed files with 1 additions and 13 deletions
|
@ -62,19 +62,7 @@ func (b *SpotifyApiBackend) InitConfig(config *config.ServiceConfig) error {
|
|||
}
|
||||
|
||||
func (b *SpotifyApiBackend) OAuth2Strategy(redirectURL *url.URL) auth.OAuth2Strategy {
|
||||
conf := oauth2.Config{
|
||||
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,
|
||||
}
|
||||
|
||||
conf := b.OAuth2Config(redirectURL)
|
||||
return auth.NewStandardStrategy(conf)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue