19 lines
294 B
Go
19 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)
|
||
|
}
|