spotify
spotify copied to clipboard
func (a Authenticator) Token() more portable
Hi! I appreciate all the work that's gone into this pkg, and this PR helps make it more a little more reusable.
This PR makes func (a Authenticator) Token()
now takes the redirected URL rather than a http.Request
(which assumes Go was used as a server to receive the redirect and makes less sense to pass in).
It's either this or also add a http.Request
variant of func (a Authenticator) Token()
to other calls to have to be changed, but I think it makes more sense to take in the URL than the reader.
For example, in our project, we get the redirect URL pass to us as a string, so func (a Authenticator) Token()
is not usable if it only accepts a http.Request
to pull the URL from.