/*
* Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
*
* This file is licensed under AGPL-3.0-or-later, see NOTICE and LICENSE for
* more information.
*/
package handlers
import (
"net/http"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
)
func AuthLogout(c *gin.Context) {
session := sessions.Default(c)
session.Clear()
_ = session.Save()
/*
logoutUrl, err := url.Parse("https://" + config.TixeConfig.OidcDomain + "/logout")
if err != nil {
c.String(http.StatusInternalServerError, err.Error())
return
}
params := url.Values{}
params.Add("returnTo", config.TixeConfig.Scheme + "://" + config.TixeConfig.Host)
params.Add("client_id", config.TixeConfig.OidcClientID)
logoutUrl.RawQuery = params.Encode()
c.Redirect(http.StatusTemporaryRedirect, logoutUrl.String())
*/
c.Redirect(http.StatusTemporaryRedirect, "/")
}