Dan Cech 8 лет назад
Родитель
Сommit
a09044a45a
2 измененных файлов с 13 добавлено и 13 удалено
  1. 1 1
      pkg/social/generic_oauth.go
  2. 12 12
      pkg/social/social.go

+ 1 - 1
pkg/social/generic_oauth.go

@@ -225,7 +225,7 @@ func (s *SocialGenericOAuth) UserInfo(client *http.Client, token *oauth2.Token)
 	return userInfo, nil
 	return userInfo, nil
 }
 }
 
 
-func (s *SocialGenericOAuth) extractToken(data *UserInfoJson, token *oauth2.Token) (bool) {
+func (s *SocialGenericOAuth) extractToken(data *UserInfoJson, token *oauth2.Token) bool {
 	idToken := token.Extra("id_token")
 	idToken := token.Extra("id_token")
 	if idToken == nil {
 	if idToken == nil {
 		s.log.Debug("No id_token found", "token", token)
 		s.log.Debug("No id_token found", "token", token)

+ 12 - 12
pkg/social/social.go

@@ -102,9 +102,9 @@ func NewOAuthService() {
 		// GitHub.
 		// GitHub.
 		if name == "github" {
 		if name == "github" {
 			SocialMap["github"] = &SocialGithub{
 			SocialMap["github"] = &SocialGithub{
-				SocialBase:           &SocialBase{
-					Config:               &config,
-					log:                  logger,
+				SocialBase: &SocialBase{
+					Config: &config,
+					log:    logger,
 				},
 				},
 				allowedDomains:       info.AllowedDomains,
 				allowedDomains:       info.AllowedDomains,
 				apiUrl:               info.ApiUrl,
 				apiUrl:               info.ApiUrl,
@@ -117,9 +117,9 @@ func NewOAuthService() {
 		// Google.
 		// Google.
 		if name == "google" {
 		if name == "google" {
 			SocialMap["google"] = &SocialGoogle{
 			SocialMap["google"] = &SocialGoogle{
-				SocialBase:           &SocialBase{
-					Config:               &config,
-					log:                  logger,
+				SocialBase: &SocialBase{
+					Config: &config,
+					log:    logger,
 				},
 				},
 				allowedDomains: info.AllowedDomains,
 				allowedDomains: info.AllowedDomains,
 				hostedDomain:   info.HostedDomain,
 				hostedDomain:   info.HostedDomain,
@@ -131,9 +131,9 @@ func NewOAuthService() {
 		// Generic - Uses the same scheme as Github.
 		// Generic - Uses the same scheme as Github.
 		if name == "generic_oauth" {
 		if name == "generic_oauth" {
 			SocialMap["generic_oauth"] = &SocialGenericOAuth{
 			SocialMap["generic_oauth"] = &SocialGenericOAuth{
-				SocialBase:           &SocialBase{
-					Config:               &config,
-					log:                  logger,
+				SocialBase: &SocialBase{
+					Config: &config,
+					log:    logger,
 				},
 				},
 				allowedDomains:       info.AllowedDomains,
 				allowedDomains:       info.AllowedDomains,
 				apiUrl:               info.ApiUrl,
 				apiUrl:               info.ApiUrl,
@@ -156,9 +156,9 @@ func NewOAuthService() {
 			}
 			}
 
 
 			SocialMap["grafana_com"] = &SocialGrafanaCom{
 			SocialMap["grafana_com"] = &SocialGrafanaCom{
-				SocialBase:           &SocialBase{
-					Config:               &config,
-					log:                  logger,
+				SocialBase: &SocialBase{
+					Config: &config,
+					log:    logger,
 				},
 				},
 				url:                  setting.GrafanaComUrl,
 				url:                  setting.GrafanaComUrl,
 				allowSignup:          info.AllowSignup,
 				allowSignup:          info.AllowSignup,