Browse Source

Login: only enabled oauth options are shown on login page

Torkel Ödegaard 11 years ago
parent
commit
aa261bbe23
2 changed files with 5 additions and 1 deletions
  1. 1 1
      grafana
  2. 4 0
      pkg/api/login.go

+ 1 - 1
grafana

@@ -1 +1 @@
-Subproject commit 4572747bd60c688f7cc2cbf8a2303b9c95ad7b9d
+Subproject commit 017eab8dcd182b8c19f65657fc3d46e30545b7ff

+ 4 - 0
pkg/api/login.go

@@ -22,6 +22,10 @@ func LoginView(c *middleware.Context) {
 		return
 		return
 	}
 	}
 
 
+	settings := c.Data["Settings"].(map[string]interface{})
+	settings["googleAuthEnabled"] = setting.OAuthService.Google
+	settings["githubAuthEnabled"] = setting.OAuthService.GitHub
+
 	// Check auto-login.
 	// Check auto-login.
 	uname := c.GetCookie(setting.CookieUserName)
 	uname := c.GetCookie(setting.CookieUserName)
 	if len(uname) == 0 {
 	if len(uname) == 0 {