func NewGithubAdapter(clientID, clientSecret, endpointURL string) Adapter {
	if endpointURL != "" {
		github.Endpoint.AuthURL = endpointURL + "/login/oauth/authorize"
		github.Endpoint.TokenURL = endpointURL + "/login/oauth/access_token"
	}
	return &githubAdapter{&oauth2.Config{
		ClientID:     clientID,
		ClientSecret: clientSecret,
		RedirectURL:  util.GetConfig().BaseURL + "/api/v1/auth/github/callback",
		Scopes: []string{
			"(no scope)",
		},
		Endpoint: github.Endpoint,
	}}
}
NewGithubAdapter creates an oAuth adapter out of the credentials and the baseURL
package auth
import (
	"context"
	"encoding/json"
	"github.com/mxschmitt/golang-url-shortener/internal/util"
	"github.com/sirupsen/logrus"
	"golang.org/x/oauth2/github"
	"github.com/pkg/errors"
	"golang.org/x/oauth2"
)
type githubAdapter struct {
	config *oauth2.Config
}