Merge pull request #137 from guotie/master

Update github.go
This commit is contained in:
Jehiah Czebotar 2015-08-25 12:22:40 -04:00
commit ba81a0d30a

View File

@ -17,21 +17,21 @@ type GitHubProvider struct {
func NewGitHubProvider(p *ProviderData) *GitHubProvider { func NewGitHubProvider(p *ProviderData) *GitHubProvider {
p.ProviderName = "GitHub" p.ProviderName = "GitHub"
if p.LoginUrl.String() == "" { if p.LoginUrl == nil || p.LoginUrl.String() == "" {
p.LoginUrl = &url.URL{ p.LoginUrl = &url.URL{
Scheme: "https", Scheme: "https",
Host: "github.com", Host: "github.com",
Path: "/login/oauth/authorize", Path: "/login/oauth/authorize",
} }
} }
if p.RedeemUrl.String() == "" { if p.RedeemUrl == nil || p.RedeemUrl.String() == "" {
p.RedeemUrl = &url.URL{ p.RedeemUrl = &url.URL{
Scheme: "https", Scheme: "https",
Host: "github.com", Host: "github.com",
Path: "/login/oauth/access_token", Path: "/login/oauth/access_token",
} }
} }
if p.ValidateUrl.String() == "" { if p.ValidateUrl == nil || p.ValidateUrl.String() == "" {
p.ValidateUrl = &url.URL{ p.ValidateUrl = &url.URL{
Scheme: "https", Scheme: "https",
Host: "api.github.com", Host: "api.github.com",