mirror of
https://github.com/nais/wonderwall.git
synced 2026-05-15 04:46:42 +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.
32 lines
506 B
Go
32 lines
506 B
Go
package client
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type LogoutCallback interface {
|
|
PostLogoutRedirectURI() string
|
|
}
|
|
|
|
type logoutCallback struct {
|
|
Client
|
|
request *http.Request
|
|
}
|
|
|
|
func NewLogoutCallback(c Client, r *http.Request) LogoutCallback {
|
|
return &logoutCallback{
|
|
Client: c,
|
|
request: r,
|
|
}
|
|
}
|
|
|
|
func (in logoutCallback) PostLogoutRedirectURI() string {
|
|
redirect := in.config().Client().GetPostLogoutRedirectURI()
|
|
|
|
if len(redirect) == 0 {
|
|
return in.config().Wonderwall().Ingress
|
|
}
|
|
|
|
return redirect
|
|
}
|