framework/pkg/handler/user/logout.go

18 lines
294 B
Go

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)
}