package oauth import ( "github.com/markbates/goth" "github.com/markbates/goth/providers/github" "github.com/thomiceli/opengist/internal/config" "github.com/thomiceli/opengist/internal/db" ) type GitHubProvider struct { Provider URL string } func (p *GitHubProvider) RegisterProvider() error { goth.UseProviders( github.New( config.C.GithubClientKey, config.C.GithubSecret, urlJoin(p.URL, "/oauth/github/callback"), ), ) return nil } func (p *GitHubProvider) SSHKeysURL(user *db.User) string { } func (p *GitHubProvider) GetProviderUserID(user *db.User) bool { return user.GithubID != "" } func NewGitHubProvider(url string) *GitHubProvider { return &GitHubProvider{ URL: url, } }