feat(sso/server): redirect to login for wildcard handler

This commit is contained in:
Trong Huu Nguyen
2023-03-29 09:55:16 +02:00
parent 323362073f
commit ef8c7d2cca
+3 -2
View File
@@ -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)
}