parcoursmob/handlers/auth/disconnect.go

14 lines
290 B
Go
Raw Permalink Normal View History

2023-01-17 07:31:07 +00:00
package auth
import "net/http"
func (h *AuthHandler) Disconnect(w http.ResponseWriter, r *http.Request) {
session, err := h.idp.SessionsStore.Get(r, "parcoursmob_session")
if err == nil {
session.Options.MaxAge = -1
session.Save(r, w)
}
http.Redirect(w, r, "/", http.StatusOK)
}