framework/pkg/handler/user/logout.go

19 lines
294 B
Go
Raw Permalink Normal View History

2024-10-12 02:52:22 +03:00
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)
}