Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion providers/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ var (
EmailURL = "https://api.github.com/user/emails"
)

var (
// ErrNoVerifiedGitHubPrimaryEmail user doesn't have verified primary email on GitHub
ErrNoVerifiedGitHubPrimaryEmail = errors.New("The user does not have a verified, primary email address on GitHub")
)

// New creates a new Github provider, and sets up important connection details.
// You should always call `github.New` to get a new Provider. Never try to create
// one manually.
Expand Down Expand Up @@ -207,7 +212,7 @@ func getPrivateMail(p *Provider, sess *Session) (email string, err error) {
return v.Email, nil
}
}
return email, fmt.Errorf("The user does not have a verified, primary email address on GitHub")
return email, ErrNoVerifiedGitHubPrimaryEmail
}

func newConfig(provider *Provider, authURL, tokenURL string, scopes []string) *oauth2.Config {
Expand Down