diff --git a/main.go b/main.go index 73a84ac..5cf72df 100644 --- a/main.go +++ b/main.go @@ -86,7 +86,11 @@ func main() { oauthproxy := NewOauthProxy(upstreamUrls, *clientID, *clientSecret, validator) oauthproxy.SetRedirectUrl(redirectUrl) if len(googleAppsDomains) != 0 && *authenticatedEmailsFile == "" { - oauthproxy.SignInMessage = fmt.Sprintf("using a email address from the following domains: %v", strings.Join(googleAppsDomains, ", ")) + if len(googleAppsDomains) > 1 { + oauthproxy.SignInMessage = fmt.Sprintf("Authenticate using one of the following domains: %v", strings.Join(googleAppsDomains, ", ")) + } else { + oauthproxy.SignInMessage = fmt.Sprintf("Authenticate using %v", googleAppsDomains[0]) + } } if *htpasswdFile != "" { oauthproxy.HtpasswdFile, err = NewHtpasswdFromFile(*htpasswdFile) diff --git a/templates.go b/templates.go index a0e2a91..7d29c40 100644 --- a/templates.go +++ b/templates.go @@ -9,26 +9,95 @@ func getTemplates() *template.Template { t, err := template.New("foo").Parse(`{{define "sign_in.html"}} -Sign In - - - + + Sign In + + +
- - {{.SignInMessage}} + {{ if .SignInMessage }} +

{{.SignInMessage}}

+ {{ end}} +
+
+ {{ if .Htpasswd }} -
-
+
+
+
+ + + {{ end }} @@ -40,7 +109,10 @@ func getTemplates() *template.Template { t, err = t.Parse(`{{define "error.html"}} -{{.Title}} + + {{.Title}} + +

{{.Title}}

{{.Message}}