aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/user/logout.go
blob: 9b7ea5f5759eb913c06c64ee3269cc54b4c3e9cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package user

import (
	"net/http"

	"github.com/labstack/echo/v4"
	"go.neonxp.ru/framework/pkg/utils"
)

func (*Handler) Logout(c echo.Context) error {
	if err := utils.SetUser(c, nil, -1); err != nil {
		return err
	}

	utils.HTMXRedirect(c, "/")

	return c.NoContent(http.StatusNoContent)
}