mauth loov.dev/mauth is a package for managing OAuth2 sessions. It's largely based on github.com/markbates/goth/gothic, however without any global variables.