zmb3 / spotify

A Go wrapper for the Spotify Web API
Apache License 2.0
1.34k stars 284 forks source link

Extend authcode example to include setting client-id, client secret and reusing saved token #137

Closed fabstu closed 2 years ago

fabstu commented 3 years ago

There are multiple issues showing that it is not clear that client-id and client-secret are needed for the refresh. This PR makes it clear in the hopes we see less issues.

zmb3 commented 3 years ago

You shouldn't need to set the client ID and secret if you're using the default environment variables.

https://github.com/zmb3/spotify/blob/9bec46940cc04f095544e94c0cbc79e7772fd61d/auth.go#L97-L98

fabstu commented 3 years ago

This is true. 👍 The point here is for people using different variables or loading from different places. They have to use ˋSetAuthInfoˋ for the first time and for the refresh. This was not clear to me, this PR aims to make it so. I know this now so I do not care much but new users might stumble here which, I feel, is unnecessary.

If you think pointing this out here is unnecessary, then feel free to close this. 👍 Or make it a different example showing how to reuse a token when loading the variables manually?

strideynet commented 2 years ago

Closing as abandoned for now, plus the API has changed significantly.