diff --git a/internal/oidc/login/get_login_handler.go b/internal/oidc/login/get_login_handler.go index c7bc335e..18b3ba8c 100644 --- a/internal/oidc/login/get_login_handler.go +++ b/internal/oidc/login/get_login_handler.go @@ -16,16 +16,14 @@ var ( rawHTMLTemplate string ) -var parsedHTMLTemplate = template.Must(template.New("login_post.gohtml").Parse(rawHTMLTemplate)) - type PageData struct { State string IDPName string } func NewGetHandler(upstreamIDPs oidc.UpstreamIdentityProvidersLister) HandlerFunc { + var parsedHTMLTemplate = template.Must(template.New("login_post.gohtml").Parse(rawHTMLTemplate)) return func(w http.ResponseWriter, r *http.Request, encodedState string, decodedState *oidc.UpstreamStateParamData) error { - err := parsedHTMLTemplate.Execute(w, &PageData{State: encodedState, IDPName: decodedState.UpstreamName}) if err != nil { return err diff --git a/internal/oidc/login/get_login_handler_test.go b/internal/oidc/login/get_login_handler_test.go index cbb48103..97ebf990 100644 --- a/internal/oidc/login/get_login_handler_test.go +++ b/internal/oidc/login/get_login_handler_test.go @@ -1,3 +1,6 @@ +// Copyright 2022 the Pinniped contributors. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + package login import ( @@ -22,19 +25,23 @@ func TestGetLogin(t *testing.T) {

Pinniped

some-ldap-idp

-
+
- - + +
- - + +
- +
+ +
+ +
diff --git a/internal/oidc/login/login_form.gohtml b/internal/oidc/login/login_form.gohtml index adb5c2a9..7bc61878 100644 --- a/internal/oidc/login/login_form.gohtml +++ b/internal/oidc/login/login_form.gohtml @@ -8,15 +8,15 @@ SPDX-License-Identifier: Apache-2.0

Pinniped

{{ .IDPName }}

-
+
- +
- +
@@ -24,7 +24,7 @@ SPDX-License-Identifier: Apache-2.0 - +