saasitone/controllers/logout.go

20 lines
307 B
Go
Raw Normal View History

2021-12-11 20:17:12 -08:00
package controllers
import (
"goweb/auth"
"goweb/msg"
"github.com/labstack/echo/v4"
)
type Logout struct {
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")
}