DEVELOPMENT ENVIRONMENT

~liljamo/tixe

ref: 960570f130cd5d9e4f2376edd399874c6740f650 tixe/handlers/authlogout.go -rw-r--r-- 703 bytes
960570f1Jonni Liljamo fix: make placeholder lighter in tag input 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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, "/")
}