feat(handler/sso/server): return not found instead of redirect for wildcard handler

This commit is contained in:
Trong Huu Nguyen
2023-04-13 14:20:38 +02:00
parent 5ad603395c
commit bab62c072b

View File

@@ -6,7 +6,6 @@ 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"
)
@@ -45,7 +44,7 @@ func (s *SSOServer) LogoutLocal(w http.ResponseWriter, r *http.Request) {
s.Standalone.LogoutLocal(w, r)
}
// Wildcard redirects all requests to the login endpoint.
// Wildcard returns HTTP 404 Not Found.
func (s *SSOServer) Wildcard(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, paths.OAuth2+paths.Login, http.StatusTemporaryRedirect)
http.NotFound(w, r)
}