spotify icon indicating copy to clipboard operation
spotify copied to clipboard

func (a Authenticator) Token() more portable

Open drew-512 opened this issue 1 year ago • 1 comments

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.

drew-512 avatar May 23 '23 14:05 drew-512

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.

drew-512 avatar May 23 '23 14:05 drew-512