diff --git a/internal/oidc/login/get_login_handler.go b/internal/oidc/login/get_login_handler.go index a8f90216..a34f487c 100644 --- a/internal/oidc/login/get_login_handler.go +++ b/internal/oidc/login/get_login_handler.go @@ -28,6 +28,7 @@ type PageData struct { HasAlertError bool AlertMessage string Title string + PostPath string } func NewGetHandler(upstreamIDPs oidc.UpstreamIdentityProvidersLister) HandlerFunc { @@ -44,6 +45,7 @@ func NewGetHandler(upstreamIDPs oidc.UpstreamIdentityProvidersLister) HandlerFun HasAlertError: alertError != "", AlertMessage: message, Title: "Pinniped", + PostPath: r.URL.Path, // the path for POST is the same as for GET }) 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 7e4d8c56..3235fcc5 100644 --- a/internal/oidc/login/get_login_handler_test.go +++ b/internal/oidc/login/get_login_handler_test.go @@ -98,7 +98,7 @@ func TestGetLogin(t *testing.T) { tt := test t.Run(tt.name, func(t *testing.T) { handler := NewGetHandler(tt.idps) - target := "/login?state=" + tt.encodedState + target := "/some/path/login?state=" + tt.encodedState if tt.errParam != "" { target += "&err=" + tt.errParam } @@ -126,7 +126,7 @@ func getHTMLResult(errorBanner string) string {

Pinniped

some-ldap-idp

%s -
+
diff --git a/internal/oidc/login/login_form.gohtml b/internal/oidc/login/login_form.gohtml index 5376b5e4..6dd4819d 100644 --- a/internal/oidc/login/login_form.gohtml +++ b/internal/oidc/login/login_form.gohtml @@ -15,7 +15,7 @@ SPDX-License-Identifier: Apache-2.0 {{.AlertMessage}}
{{end}} - +