pollo/api/signout.go

18 lines
337 B
Go
Raw Normal View History

2024-06-27 21:51:00 -06:00
package api
import (
"net/http"
"pollo/lib"
"github.com/labstack/echo/v4"
)
func SignOutUserHandler(c echo.Context) error {
// Clear the session cookie
2024-06-28 00:35:58 -06:00
lib.ClearSessionCookie(c.Response().Writer, "session")
2024-06-27 21:51:00 -06:00
// Proceed with login success logic
c.Response().Header().Set("HX-Redirect", "/")
return c.NoContent(http.StatusOK)
}