From ef8c7d2ccae8bc085d36cf3754460eeb51b92b1f Mon Sep 17 00:00:00 2001 From: Trong Huu Nguyen Date: Wed, 29 Mar 2023 09:54:35 +0200 Subject: [PATCH] feat(sso/server): redirect to login for wildcard handler --- pkg/handler/handler_sso_server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/handler/handler_sso_server.go b/pkg/handler/handler_sso_server.go index eb3f4f8..8b70b19 100644 --- a/pkg/handler/handler_sso_server.go +++ b/pkg/handler/handler_sso_server.go @@ -6,6 +6,7 @@ import ( "github.com/nais/wonderwall/pkg/config" "github.com/nais/wonderwall/pkg/cookie" "github.com/nais/wonderwall/pkg/router" + "github.com/nais/wonderwall/pkg/router/paths" "github.com/nais/wonderwall/pkg/url" ) @@ -44,7 +45,7 @@ func (s *SSOServer) LogoutLocal(w http.ResponseWriter, r *http.Request) { s.Standalone.LogoutLocal(w, r) } -// Wildcard returns HTTP 404 Not Found. +// Wildcard redirects all requests to the login endpoint. func (s *SSOServer) Wildcard(w http.ResponseWriter, r *http.Request) { - http.NotFound(w, r) + http.Redirect(w, r, paths.OAuth2+paths.Login, http.StatusTemporaryRedirect) }