saasitone/routes/logout.go
2021-12-14 11:13:53 -05:00

21 lines
333 B
Go

package routes
import (
"goweb/auth"
"goweb/controller"
"goweb/msg"
"github.com/labstack/echo/v4"
)
type Logout struct {
controller.Controller
}
func (l *Logout) Get(c echo.Context) error {
if err := auth.Logout(c); err == nil {
msg.Success(c, "You have been logged out successfully.")
}
return l.Redirect(c, "home")
}