mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #6952 from huydx/format-gofmt
(format) run go fmt in pkg
This commit is contained in:
commit
38d8ba8faa
@ -56,7 +56,7 @@ func OAuthLogin(ctx *middleware.Context) {
|
|||||||
if setting.OAuthService.OAuthInfos[name].HostedDomain == "" {
|
if setting.OAuthService.OAuthInfos[name].HostedDomain == "" {
|
||||||
ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline))
|
ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline))
|
||||||
} else {
|
} else {
|
||||||
ctx.Redirect(connect.AuthCodeURL(state, oauth2.SetParam("hd", setting.OAuthService.OAuthInfos[name].HostedDomain), oauth2.AccessTypeOnline));
|
ctx.Redirect(connect.AuthCodeURL(state, oauth2.SetParam("hd", setting.OAuthService.OAuthInfos[name].HostedDomain), oauth2.AccessTypeOnline))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ import (
|
|||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
type DatabaseConfig struct {
|
type DatabaseConfig struct {
|
||||||
Type, Host, Name, User, Pwd, Path, SslMode string
|
Type, Host, Name, User, Pwd, Path, SslMode string
|
||||||
CaCertPath string
|
CaCertPath string
|
||||||
|
@ -186,7 +186,7 @@ func (s *GenericOAuth) UserInfo(client *http.Client) (*BasicUserInfo, error) {
|
|||||||
Email: data.Email,
|
Email: data.Email,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userInfo.Email == "" && data.Attributes["email:primary"] != nil) {
|
if userInfo.Email == "" && data.Attributes["email:primary"] != nil {
|
||||||
userInfo.Email = data.Attributes["email:primary"][0]
|
userInfo.Email = data.Attributes["email:primary"][0]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,11 +197,11 @@ func (s *GenericOAuth) UserInfo(client *http.Client) (*BasicUserInfo, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userInfo.Login == "" && data.Username != "") {
|
if userInfo.Login == "" && data.Username != "" {
|
||||||
userInfo.Login = data.Username
|
userInfo.Login = data.Username
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userInfo.Login == "") {
|
if userInfo.Login == "" {
|
||||||
userInfo.Login = data.Email
|
userInfo.Login = data.Email
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@ package opentsdb
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||||
"github.com/grafana/grafana/pkg/tsdb"
|
"github.com/grafana/grafana/pkg/tsdb"
|
||||||
. "github.com/smartystreets/goconvey/convey"
|
. "github.com/smartystreets/goconvey/convey"
|
||||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestOpenTsdbExecutor(t *testing.T) {
|
func TestOpenTsdbExecutor(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user