markbates / goth

Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applications.
https://blog.gobuffalo.io/goth-needs-a-new-maintainer-626cd47ca37b
MIT License
5.56k stars 593 forks source link

Handling Refresh Tokens #189

Open rohancme opened 6 years ago

rohancme commented 6 years ago

Hi!

I've been reading through the code and I'm trying to understand if, and how, the RefreshToken(token) methods are being called.

My assumption is that calling those methods is something I would need to handle in my own code but I just wanted to make sure I wasn't missing something.

Appreciate the help! :)

terev commented 6 years ago

These methods aren't used by the codebase. They seem to be utility methods available for refreshing an access token for a given provider. You have to call these manually with a refresh token to receive a new access token. However most api clients will handle refreshing for you. For example https://github.com/zmb3/spotify uses the net/http package for making requests.