mirror of
https://github.com/nais/wonderwall.git
synced 2026-05-11 02:47:05 +00:00
As we already clear any local sessions before redirecting to the Identity Provider, and the callback always redirects to a pre-configured URL, there isn't really any need to maintain and verify state in the logout callback. In other words, the logout callback handler is simply a redirect handler.
17 lines
506 B
Go
17 lines
506 B
Go
package router
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
logentry "github.com/nais/wonderwall/pkg/router/middleware"
|
|
)
|
|
|
|
// LogoutCallback handles the callback from the self-initiated logout for the current user
|
|
func (h *Handler) LogoutCallback(w http.ResponseWriter, r *http.Request) {
|
|
redirect := h.Client.LogoutCallback(r).PostLogoutRedirectURI()
|
|
|
|
logger := logentry.LogEntry(r.Context())
|
|
logger.Info().Msgf("logout/callback: redirecting to %s", redirect)
|
|
http.Redirect(w, r, redirect, http.StatusTemporaryRedirect)
|
|
}
|