Files
wonderwall/pkg/handler/handler_logout_callback.go
Trong Huu Nguyen 5a50ba7c3a feat: support multiple ingresses
Replace hardcoded callback URLs with dynamic generation
of URLs based on incoming requests. These are validated against
a pre-registered list of ingresses for which Wonderwall is considered
authorative for.

We also preserve the cookie behaviour; the most specific ingress path
and domain is used for the cookies.

The `url` package has been moved to the `handler` package, and its
implementation refactored slightly for readability and DRY.
2022-08-17 20:43:56 +02:00

16 lines
500 B
Go

package handler
import (
"net/http"
logentry "github.com/nais/wonderwall/pkg/middleware"
)
// LogoutCallback handles the callback initiated by the self-initiated logout after single-logout at the identity provider.
func (h *Handler) LogoutCallback(w http.ResponseWriter, r *http.Request) {
redirect := h.Client.LogoutCallback(r).PostLogoutRedirectURI()
logentry.LogEntry(r).Debugf("logout/callback: redirecting to %s", redirect)
http.Redirect(w, r, redirect, http.StatusTemporaryRedirect)
}