mirror of
https://github.com/nais/wonderwall.git
synced 2026-05-08 17:37:01 +00:00
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.
16 lines
500 B
Go
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)
|
|
}
|