Skip to content

Commit

Permalink
feat: make spotify redirect uri configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjules committed Apr 11, 2022
1 parent 73db623 commit fd39c95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ type Config struct {
Prod bool `envconfig:"PROD" default:"false"`
SpotifyClientID string `envconfig:"SPOTIFY_CLIENT_ID" required:"true"`
SpotifyClientSecret string `envconfig:"SPOTIFY_CLIENT_SECRET" required:"true"`
HttpServerHost string `envconfig:"HTTP_SERVER_HOST" default:"localhost"`
SpotifyRedirectURI string `envconfig:"SPOTIFY_REDIRECT_URI" default:"http://0.0.0.0:13337/api/callback"`
HttpServerHost string `envconfig:"HTTP_SERVER_HOST" default:"0.0.0.0"`
HttpServerPort int `envconfig:"HTTP_SERVER_PORT" default:"13337"`
CacheMaxKeys int64 `envconfig:"CACHE_MAX_KEYS" default:"64"`
CacheMaxCost int64 `envconfig:"CACHE_MAX_COST" default:"1000000"`
Expand Down
2 changes: 1 addition & 1 deletion spoty/spoty.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func New(
}

auth := spotify.NewAuthenticator(
fmt.Sprintf("http://%s:%d/api/callback", cfg.HttpServerHost, cfg.HttpServerPort),
cfg.SpotifyRedirectURI,
spotify.ScopeUserReadCurrentlyPlaying,
spotify.ScopeUserReadPlaybackState,
)
Expand Down

0 comments on commit fd39c95

Please sign in to comment.